import smtplib
from email.mime.text import MIMEText
SMTPServer = "smtp.163.com"
sender = "xxxx@163.com"
passwd = "123456"
receiver= "yyyy@163.com"
messages = "the server 10.0.1.1 is down"
msg = MIMEText(messages)
#this is a theam
msg["Subject"] = "test"
#sender
msg["From"] = sender
mailServer = smtplib.SMTP(SMTPServer,25)
mailServer.login(sender,passwd)
mailServer.sendmail(sender,[receiver,'112345@qq.com','123456@qq.com'],msg.as_string())
mailServer.quit()
网友评论