Pythonjiaocheng/20171102/553.html">python">from email.mime.text import MIMEText
import smtplib
import getpass
msg = MIMEText('这是一封来自Pythonjiaocheng/20171102/553.html">python的纯文本邮件','plain','utf-8')
from_addr = '发件人邮箱地址'
password = getpass.getpass('Password:')
smtp_server = 'smtp.163.com'
smtp_port = 994
to_addr = '收件人邮箱地址*'
server = smtplib.SMTP(smtp_server,smtp_port)
server.starttls()
server.set_debuglevel(1)
server.login(from_addr,password)
server.sendmail(from_addr,[to_addr],msg.as_string())
server.quit()
标签:python