首页 > 其他 > 详细

阿里云 465端口发送邮件

时间:2018-02-05 16:57:02      阅读:240      评论:0      收藏:0      [点我收藏+]
#/usr/bin/enn python  #coding=utf-8 import smtplib from email.mime.text import MIMEText msg_from = 'w673004708@163.com'  passwd = 'H天天'  msg_to = "liuhaixia@23432"  mail_host="smtp.163.com" port= 465  subject = "python邮件测试"   content = "Hello World" msg = MIMEText(content) msg['Subject'] = subject msg['From'] = msg_from #创建连接对象并连接到服务器 s = smtplib.SMTP_SSL(mail_host,port)   # 登录服务器 mail_list = ["w67308@163.com","liuha@see.com.cn"] s.login(msg_from, passwd) i=0 for i in range(0, len(mail_list)):     msg_to = mail_list[i]     msg['To'] = msg_to      s.sendmail(msg_from, msg_to, msg.as_string())     print "发送成功"     i=i+1


阿里云 465端口发送邮件

原文:http://blog.51cto.com/wsxxsl/2069030

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