当前位置:   article > 正文

已解决python邮件发送报错smtplib.SMTPDataError: (550, b‘The “From“ header is missing or invalid._smtplib.smtpdataerror: (550, b'the "from" header i

smtplib.smtpdataerror: (550, b'the "from" header is missing or invalid. plea

使用python邮件发送时报错:smtplib.SMTPDataError: (550, b'The "From" header is missing or invalid.Please follow RFC5322,RFC2047,RFC822 standard protocol.    https://help.mail.qq.com/detail/0/994

最后经过努力成功解决该错误。详细解决过程和解决方案如下所示:

一、问题发生的现象

       在使用python发送qq邮件时,定义了如下发送邮件的代码: 

  1. .................
  2. email = MIMEText(message,send_email_type, "utf-8")
  3. email["From"] = Header(header_from, "utf-8")
  4. email["To"] = Header(header_to, "utf-8")
  5. email["Subject"] = Header(subject, "utf-8")
  6. .............................

      但运行程序时,报以下错误:

 mtplib.SMTPDataError: (550,

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/432555
推荐阅读
相关标签
  

闽ICP备14008679号