import yagmail
server=yagmail.SMTP(user="80XXXX@qq.com",password="XXXXX",host="smtp.qq.com",port=25,smtp_starttls=True,smtp_ssl=False)
content=["test"]
server.send('806416232@qq.com','Test',content,["report-2020-09-11-16_09_17.zip"])
username='uitestp4p@163.com' # 发件人的邮箱
mail_server="mtp.163.com"
password='houyafan123'm = yagmail.SMTP(user=username,password=password,host=mail_server)to = ['183190***','wangyajuan***'] #发给谁
cc = ['104690***'] #抄送
m.send(to=to,cc=cc, # to 发送给谁,cc 抄送给谁
subject='今天吃了吗',#标题
contents='今天吃鱼肉了吗,吃饱没', #正文
attachments=r'/学习/接口自动化/BestTest/10.26/book_server.log') #附件,多个附件传一个list
网友评论