import smtplib
from email.mime.text import MIMEText
from email.header import Header
smtpserver='mail.qq.com'
user='475847@qq.com'
password='1878943'
sender='475847@qq.com'
receiver='475847@qq.com'
subject='Python email test'
msg=MIMEText('<html><h1>你好!</h1></html>','html','utf-8')
msg['Subject']=Header(subject,'utf-8')
smtp=smtplib.SMTP()
smtp.connect(smtpserver)
smtp.login(user,password)
smtp.sendmail(sender,receiver,msg.as_string())
smtp.quit()
自动化测试之发送邮件
最新推荐文章于 2024-04-12 02:20:13 发布