赞
踩
使用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邮件时,定义了如下发送邮件的代码:
- .................
- email = MIMEText(message,send_email_type, "utf-8")
- email["From"] = Header(header_from, "utf-8")
-
- email["To"] = Header(header_to, "utf-8")
- email["Subject"] = Header(subject, "utf-8")
- .............................
但运行程序时,报以下错误:
mtplib.SMTPDataError: (550,
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。