标签:python tle smtp ext sendmail toad log content ring
import smtplib
from email.mime.text import MIMEText
def SendEmail(fromAdd,toAdd,subject,text):
_pwd = "Yeer2016@sudai" #授权码
msg = MIMEText(text)
msg["Subject"] = subject
msg["From"] = fromAdd
msg["To"] = toAdd
try:
s = smtplib.SMTP_SSL("smtp.sudaizhijia.com", 465)
s.login(fromAdd, _pwd)
s.sendmail(fromAdd, toAdd, msg.as_string())
s.quit()
print ("Success!")
except smtplib.SMTPException:
print(‘Falied!‘)
if __name__==‘__main__‘:
from_="tech-report@sudaizhijia.com" #你的邮箱 发件地址
to_sender_address_list = ["11.qq,com","33.qq.com"] #收件地址
subject = input(‘Please input title:‘) #邮件标题
text= input(‘Please input Content:‘) #邮件内容
for i in to_sender_address_list:
SendEmail(from_,i,subject,text)
标签:python tle smtp ext sendmail toad log content ring
原文地址:https://www.cnblogs.com/wangruwei/p/9438711.html