我正在尝试使用python发送电子邮件,下面是我的基本代码:
mail_host = MAIL_HOST
mail_user = MAIL_USER
mail_pass = MAIL_PASS
mail_postfix = MAIL_POSTFIX
self.server = smtplib.SMTP(mail_host, port=MAIL_PORT)
self.server.ehlo()
self.server.starttls()
self.server.login(mail_user + "@" + mail_postfix, mail_pass)
self.my_name = MAIL_DISPLAY_SENDER
self.my_addr = self.my_name+"<"+mail_user+"@"+mail_postfix+">"
self.server.sendmail(self.my_addr, "liping.zhang@cimc.com", message.as_string())
然后我得到了这个错误:
smtplib.SMTPDataError: (554, b'5.2.0 STOREDRV.Submission.Exception:InvalidRecipientsException; Failed to process message due to a permanent exception with message Recipient "liping.zhang@cimc.com" isn\'t resolved. All recipients must be resolved before a message can be submitted. InvalidRecipientsException: Recipient "liping.zhang@cimc.com" isn\'t resolved. All recipients must be resolved before a message can be submitted. [Hostname=HK2PR01MB3123.apcprd01.prod.exchangelabs.com]')
这里发生了什么事?我的代码有什么问题吗
谢谢
尝试更改要发送的邮件的主题行。 如果你一天内发了太多的电子邮件,那就试试看 改天再发
相关问题 更多 >
编程相关推荐