import zmail #发送测试报告到邮件with open(r'F:\asus\auto_file\unittest_html\2019-06-30 10-31-03report.html','r',encoding="utf-8") as f: #获取测试报告 content_html = f.read() mail_content = {'subject':'zmail send mail successj', #标题随意写'content_text':'赶紧工作', #邮件正文内容,随意写'content_html':content_html #报告内容} server = zmail.server('240831102@qq.com','zlzavvyqtglbcaid') #此处需要的是发送者的邮箱和授权码。授权码在qq邮箱中设置。需要打开pop3/smtpserver.send_mail('424395718@qq.com',mail_content) #此处是目的邮箱地址和邮件内容print('ok')