import smtplib
server=smtplib.SMTP()
server.connect("smtp.163.com",25)
server.login("user"," pwd")
server.sendmail("from@163.com","to@qq.com","'Subject: this is a email from python demo\r\n\r\nJust for test~_~'")
server.quit()
import smtplib
server=smtplib.SMTP()
server.connect("smtp.163.com",25)
server.login("user"," pwd")
server.sendmail("from@163.com","to@qq.com","'Subject: this is a email from python demo\r\n\r\nJust for test~_~'")
server.quit()
转载于:https://www.cnblogs.com/foxhengxing/archive/2011/09/29/2195716.html