Python-----发邮件

import yagmail

username='**@163.com'
#密码使用授权码(python规定 163,qq邮箱使用授权码)
passwd='***'
mail=yagmail.SMTP(user=username,password=passwd,host='smtp.163.com')
#cc抄送 attachement发送附件
mail.send(to='106148088@qq.com',subject='nihao',contents='hello',attachments=r'C:Userseamil副本.txt')
原文地址:https://www.cnblogs.com/wenchengqingfeng/p/10101835.html