python email times wrong 554
Error:
Smtplib. Smtpdataerror: (554, B ' dt:spm 163 SMTP10,DSCOWAA3H9_QBGZXI9_FCQ--. 713s2 1460039376,please-http://mail.163.com/ Help/help_
Solve:
The subject cannot be test or the error is correct and
Smtp.sendmail (' wangxxxx@126.com ', ' 153xxxx@qq.com ', msg.as_string ())
Inside of the and:
Msg[' from '] = ' wangxxxx@126.com '
msg[' to '] = ' 153xxxx@qq.com '
Must be consistent, or there will be 554 mistakes.
Send mail code:
Import smtplib
import email.mime.multipart
import email.mime.text
msg = Email.mime.multipart.MIMEMultipart () "Finally finally
found a solution: The message subject to ' test ' when there will be errors, replaced by other words is good. I don't know what this is about.
"
msg[' Subject '] = ' duanx ' msg[' from
'" = ' wangxxxx@126.com ' msg[' to
'] = ' 153xxxx@qq.com '
content = '
Hello, xiaoming
This is an automatically sent message.
www.ustchacker.com
'
txt = email.mime.text.MIMEText (content)
Msg.attach (txt)
#smtp = Smtplib
smtp = Smtplib. SMTP ()
smtp.connect (' smtp.126.com ', ') '
smtp.login (' wangxxxx@126.com ', ' Hu Jintao ')
Smtp.sendmail ( ' wangxxxx@126.com ', ' 153xxxx@qq.com ', msg.as_string ())
smtp.quit ()
print (' Mail sent successfully email has send out! ')