R. David Murray added the comment: Although that will work for text-only messages if you know what RFC format looks like, you really don't want to do that in the general case, since you can't express messages that have binary non-text content using unicode. What you want to do is prepare your message in correct RFC form, which is what the email library is for. With the new API (provisional now, but any changes will be minor when it becomes final in 3.6), this is even easy (see the 'contentmanager' docs). Then you call smtplib.send_message, and the encoding to RFC format is taken care of for you. In 3.5 it even supports SMTPUTF8, if you know any servers that do :)
---------- nosy: +r.david.murray resolution: -> not a bug stage: -> resolved status: open -> closed _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25736> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com