使用Python和smtplib发送电子邮件,收到两封重复的电子邮件

时间:2017-05-04 00:48:22

标签: python smtplib os.path

Python newb here。我正在尝试在处理命令后发送电子邮件。当我测试时,我收到两封重复的电子邮件而不是1.我的代码在下面。

import smtplib
import os.path

from email.mime.text import MIMEText

msg = MIMEText("The report at *link* has been updated")

msg['Subject'] = "Test Report Notification **TEST**"

#put your host and port here 
s = smtplib.SMTP_SSL('###########.net:465')
s.login('system@#########','#####') 
s.sendmail('system@#####.com','bryan#########', msg.as_string())
s.quit()
print("done")

提前致谢。我真的尝试过研究。

0 个答案:

没有答案
相关问题