This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author famu xu
Recipients barry, famu xu, mangrisano, r.david.murray
Date 2019-07-13.14:20:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1563027656.0.0.057124418286.issue37572@roundup.psfhosted.org>
In-reply-to
Content
import smtplib
from email.message import EmailMessage
from email.utils import formataddr

server = smtplib.SMTP('smtp.xxx.com',port=25)
server.login('you@xxx.com', 'password')
msg = EmailMessage()

#if address username include Chinese or other multibytes language, it will be encode to utf8 and base64, like '?utf-8?B?6YKu5Lu25rWL6K+V?= <you@xxx.com>', but the raw smtp request data error, "From: xxx" and "To: xxx" fields has the error end char:"\r\r\r\r\n".
#From: ?utf-8?B?6YKu5Lu25rWL6K+V?= <you@xxx.com>\r\r\r\r\n

msg['From'] =formataddr(('中文','you@xxx.com'))
msg['To'] = formataddr(('中文姓名','to@yyy.com'))

msg['Subject'] =subject
msg.set_content('something')

server.send_message(msg)
server.quit()
History
Date User Action Args
2019-07-13 14:20:56famu xusetrecipients: + famu xu, barry, r.david.murray, mangrisano
2019-07-13 14:20:56famu xusetmessageid: <1563027656.0.0.057124418286.issue37572@roundup.psfhosted.org>
2019-07-13 14:20:55famu xulinkissue37572 messages
2019-07-13 14:20:55famu xucreate