python 3.5.2 发送邮件提示

风一样汉子 2016-08-26 05:08:10
提示错误:
raise SMTPServerDisconnected("Connection unexpectedly closed")
smtplib.SMTPServerDisconnected: Connection unexpectedly closed


import smtplib
from email.mime.text import MIMEText

me = 'wewsa265@163.com'
pw = 'qweas123098'
you =['koio@163.com']

msg =MIMEText('hello, send by Python...', 'plain', 'utf-8')
msg['Subject'] = 'The contents of %s'
msg['From'] = me
msg['To'] = you

server = smtplib.SMTP('smtp.163.com',465)
server.starttls()
server .login(me,pw)
server .sendmail(me, [you], msg.as_string())
server .quit()
...全文
634 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
机制小风风 2016-09-15
  • 打赏
  • 举报
回复
发邮件可以试试 yagmail 超级简单~

37,737

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • WuKongSecurity@BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧