使用yagmail发邮件

直接上代码吧

import  yagmail
yag = yagmail.SMTP(user="xxxx@163.com",password="Jxxxxx",host="smtp.163.com")  # password 这里不是登录密码,是授权码
to = "lifq@hahah.com"
subject="测试"
contents=["测试内容"]
yag.send(to=to,subject=subject,contents=contents)

 

posted @ 2023-05-24 11:01  羊脂玉净瓶  阅读(8)  评论(0)    收藏  举报