Python发邮件

终于,终于,终于有了发邮件的库
感动得快哭了,不用自己写一大坨

import yagmail

链接邮箱服务器

wy = yagmail.SMTP( user="[email protected]", password="1234", host='smtp.126.com')
password 通常是 授权码

发送邮件

wy.send(to=['收件人邮箱', '[email protected]', '[email protected]'], subject="主题",
contents=['我要发送的内容', '附件])

你可能感兴趣的:(Python发邮件)