为什么我使用smtp.sendmail(toAddress、fromAddress、message)时邮件不显示?

2024-10-02 10:18:28 发布

您现在位置:Python中文网/ 问答频道 /正文

我在Automate the Boring Stuff with Python为一个实践项目制作了一个应用程序,它获取了一个家务清单,并将一个随机家务分配给电子邮件清单中的每个电子邮件地址。我使用的电子邮件是outlook和gmail,它们是我自己的帐户。发送消息的基本代码如下所示:

smtpObj = smtp.SMTP('smtp-mail.outlook.com', 587)
smtpObj.ehlo()
smtpObj.starttls()
smtpObj.login(<my_email>, password>
smtp.sendmail(my_email, <email_from_list>, message)

它发送的电子邮件很好,但收到时是空的。为什么会这样


Tags: the项目应用程序电子邮件emailmy地址with

热门问题