首页 > 编程语言 > 详细

Python 发送邮件

时间:2021-02-05 12:59:33      阅读:26      评论:0      收藏:0      [点我收藏+]
import yamail

password="amyli1499"
host="smtp.163.com"  #smtp.qq.com
user="meiyanshandong@163.com"
to = ["zhangmeiyan01@renmaitech.com"]
cc = ["549541889@qq.com"]
def send_mail(subject,content,files=None):
smtp = yamail.SMTP(host=host,
user=user,
password=password,
)
smtp.send(to=to, cc=cc, subject=subject, contents=content, attachments=files)

if __name__ == "__main__":
file= ‘../Mia.jpg‘
send_mail("sub test","新年好",file)

Python 发送邮件

原文:https://www.cnblogs.com/zhangmeiyan/p/14376968.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!