Python email times Wrong 554__python

Source: Internet
Author: User
Tags mail code
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! ')



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.