Send HTML e-mail in Python?

Max mksql at yahoo.com
Tue Nov 9 15:29:56 EST 2004


The solution was I simply missed putting the correct (and
aforementioned) content type in the message header:

msg = ("MIME-Version: 1.0\r\nContent-type: text/html;
charset=utf-8\r\nFrom: %s\r\nTo: %s\r\nSubject: Test Message\r\n" %
(mfrom, mto)) + html
smtp = smtplib.SMTP(smtpserver)
smtp.sendmail(mfrom, mto, msg)




More information about the Python-list mailing list