import smtplib
import smtplib
from smtplib import SMTP
from email.mime.text import MIMEText
from email.header import Header
msg = MIMEText('<html><h1>你好!<h1><html>','html','utf-8')
msg = MIMEText('hello,send by Python.....','plain','utf-8')
msg['From'] = 'yougege18927446164@163.com'
msg['To'] = '755680976@qq.com'
subject = 'python SMTP 测试邮件'
msg['Subject'] = Header(subject, 'utf8')
s = smtplib.SMTP() # 实例化SMTP
s.connect('smtp.163.com', port=25)
s.login(user='18927446164@163.com', password='7686100589zqx')
s.sendmail('18927446164@163.com', '755680976@qq.com', msg.as_string())
s.quit()