-----------------------------------------------------------
author:wangshinan
description:发送测试报告邮件
param:1、attachment 测试报告全路径 2、content邮件内容
remarks:需邮箱开启POP3/SMTP服务,并获取授权码(QQ邮箱-设置-帐户
-----------------------------------------------------------
ProjectInfo.project_name = “项目名称”
commonConfig.sendmail = “发送者邮箱”
commonConfig.receivemail = “接收者邮箱,多个接收者邮箱可用列表隔开”
commonConfig.PassKey = “发送者邮箱授权码”
代码:
def send_mail(self,attachment, content):
print("\033[31m开始发送测试报告......")
# 设置邮件主题
subject = "[" + time.strftime('%Y%m%d_%H%M%S', time.localtime(time.time())) + "] " + ProjectInfo.project_