使用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")
.............................
<