# 发送到邮箱
#邮箱服务器
smtpserver = 'smtp.163.com'
#发送邮箱
sender = 'username@163.com'
#发送邮箱的账号密码
username = 'username@163.com'
password = 'password'
#发送邮件主题
subject = '自动化测试报告'
#接收邮箱
receiver = 'username@163.com'
#文件内容
msg = MIMEText( HtmlFile,'html','utf-8')
msg['Subject'] = Header(subject,'utf-8')
msg['from'] = 'username@163.com'
msg['to'] = 'username@163.com'
smtp = smtplib.SMTP()
smtp.connect(smtpserver)
smtp.login('username@163.com','password')
a1=smtp.sendmail(sender,receiver,msg.as_string())
smtp.quit()
发送自动化测试报告到自己的邮箱
最新推荐文章于 2024-04-18 21:06:57 发布