import smtplib
from email.mime.text import MIMEText

subject = 'this is my first 163'br/>frommail='[email protected]'
tomail='[email protected]'

msg=MIMEText(r'ha ha')br/>msg['Subject']=subject
msg['From']=frommail
msg['To']=tomail
server=smtplib.SMTP()
server.connect('smtp.163.com')
server.login('[email protected]','miaxxxxx45')
server.sendmail(frommail,tomail,msg.as_string())

QQ邮件 开启白名单