阿里云 465端口发送邮件
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了阿里云 465端口发送邮件相关的知识,希望对你有一定的参考价值。
#/usr/bin/enn python #coding=utf-8 import smtplib from email.mime.text import MIMEText msg_from = '[email protected]' passwd = 'H天天' msg_to = "[email protected]" 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 = ["[email protected]","[email protected]"] 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端口发送邮件的主要内容,如果未能解决你的问题,请参考以下文章