Hi there, I wrote a short python script that sends an email using python's email module and I am using Python 2.3.5. The problem is, that umlauts are not displayed properly in some email clients:
+ On a windows machine running thunderbird 1.0.2 umlauts are displayed properly. The email header contains "Content-type: text/plain; charset=utf-8" so the email client's character encoding automatically switches to "Unicode (UTF-8)" + On a solaris machine running thunderbird 1.5.0.8 and on a macintosh machine running eudora umlauts are *not* displayed properly. The email header does not contain any "Content-type". If I manually switch the email client's character encoding to "Unicode (UTF-8)", the umlauts are displayed properly. Therefore, I guess it has something to do with the missing "Content-type: text/plain; charset=utf-8" information in the email header. Any idea why the "Content-type: text/plain; charset=utf-8" is missing? Here is my script: #------------------------------------------------------------------ # send email from email.Header import Header import email.Message import email.Utils import mimetypes from smtplib import SMTP host = 'mail.example.com' mFrom = '[EMAIL PROTECTED]' mTo = '[EMAIL PROTECTED]' mSubj = u'f\xfcr' mBody = u'f\xfcr foo bar' mBody = mBody.encode('UTF-8') mainMsg = email.Message.Message() mainMsg['From'] = mFrom mainMsg['To'] = mTo mainMsg['Subject'] = mSubj mainMsg.set_payload(mBody) mainMsg['Date'] = email.Utils.formatdate(localtime=1) mainMsg['Message-ID'] = email.Utils.make_msgid() mainMsg['Mime-version'] = '1.0' mainMsg['Content-type'] = 'text/plain; charset=utf-8' mainMsg['Content-transfer-encoding'] = '8bit' # 'quoted-printable' does not work either # mainMsg['Content-Transfer-Encoding'] = 'quoted-printable' s = SMTP(host) s.sendmail(mFrom, [mTo], mainMsg.as_string()) s.close() #------------------------------------------------------------------ Regards, Nico -- http://mail.python.org/mailman/listinfo/python-list