标签:imp class 邮箱 server port add from python com
import smtplib from email.mime.text import MIMEText from email.utils import formataddr msg = MIMEText(‘邮件内容‘, ‘plain‘, ‘utf-8‘) msg[‘From‘] = formataddr(["武沛齐",‘wptawy@126.com‘]) msg[‘To‘] = formataddr(["走人",‘424662508@qq.com‘]) msg[‘Subject‘] = "主题" server = smtplib.SMTP("smtp.126.com", 25) server.login("wptawy@126.com", "邮箱密码") server.sendmail(‘wptawy@126.com‘, [‘424662508@qq.com‘,], msg.as_string()) server.quit()
标签:imp class 邮箱 server port add from python com
原文地址:http://www.cnblogs.com/cloniu/p/6440372.html