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:\Users\eamil副本.txt')
posted @ 2018-12-11 14:04  文城清枫  阅读(106)  评论(0编辑  收藏  举报