Python_发送邮件

时间:2021-06-06 19:32:03   收藏:0   阅读:0
import yamail
username = "xxxxxx@qq.com"
password = "xxxxxx"
host = "smtp.qq.com"
# host = "smtp.163.com" #163
# host = "smtp.126.com" #qq
# smtp.send(to="aaaaaa@qq.com")

smtp = yamail.SMTP(host=host,user=username,password=password)
smtp.send(to=["aaaaaaa@qq.com"],
cc=["ssssssss@qq.com"],
subject="你好呀",
contents="哈哈哈哈",
attachments="qq.xls")
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!