【发布时间】:2019-10-11 04:40:16
【问题描述】:
我想通过python发送电子邮件,我按照this链接的以下代码:
import smtplib
mailserver = smtplib.SMTP('smtp.office365.com',587)
mailserver.ehlo()
mailserver.starttls()
mailserver.login('myemail@company.com', 'mypassword')
msg = ('this is a message')
mailserver.sendmail('myemail@company.com','receiver@company.com',msg)
问题: 电子邮件在我的发件箱和收件人的收件箱中,但没有文字。它是空的。
没有错误或输出,脚本只是运行,所以我不确定从哪里开始故障排除,因为我不是这方面的专家;谁能解释为什么没有消息/文本?
【问题讨论】: