Home » Computers » Programming » Sending HTML Email From Python

4 Responses to Sending HTML Email From Python

  1. You should also always add the date header. It is required accoring to RFC 822 and messages without it might have an increased spam rating. I suggest the following solution for doing so:

    msg["Date"] = email.Utils.formatdate(localtime=True)

    • I was relying on sendmail to add that header, but it’s still a good point to add it ourselves. A different MTA may not behave the same way.

      I’ve updated the body of the post accordingly, and also updated the attached .py file.

  2. Have you tested mailer?

    https://bitbucket.org/ginstrom/mailer

    Whats your opinion of it?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>