标签:jpg can aaa main 邮箱服务器 div password dom find
yagmail 可以更简单的来实现自动发邮件功能。
1 pip install yagmail
1 import yagmail 2 3 #链接邮箱服务器 4 yag = yagmail.SMTP( user="user@126.com", password="1234", host=‘smtp.126.com‘) 5 6 # 邮箱正文 7 contents = [‘This is the body, and here is just text http://somedomain/image.png‘, 8 ‘You can find an audio file attached.‘, ‘/local/path/song.mp3‘] 9 10 # 发送邮件 11 yag.send(‘taaa@126.com‘, ‘subject‘, contents)
1 # 发送邮件 2 yag.send([‘aa@126.com‘,‘bb@qq.com‘,‘cc@gmail.com‘], ‘subject‘, contents)
1 # 发送邮件 2 yag.send(‘aaaa@126.com‘, ‘发送附件‘, contents, ["d://log.txt","d://baidu_img.jpg"])
标签:jpg can aaa main 邮箱服务器 div password dom find
原文地址:https://www.cnblogs.com/zibinchen/p/11834537.html