Python发送SSL邮件提示STARTTLS extension not supported by server或Auth extensino not support by server

IDE:PyCharm Community 2017.02

Python版本:2.7.14

Windows系统


用Python邮件发送天气预报,但是因为阿里云服务器默认封禁25端口,申请解封也没通过,导致只能用465端口SSL方式发送,但是遇到很多问题:

代码如下:


开始提示:SMTP Auth extension bot support by server


在网上查了资料,说是在s.helo()和s.login()之间加上s.starttls(),暂时不管是什么意思,加上试试

但是加上了出现了新的问题:STARTTLS extension not supported by server.


又查了很多资料,但是都找到解决方法!

最后,解决方法试出来了,什么原因还有待考察:直接去掉s.helo(),s.starttls()问题就解决了!如下:



posted @ 2018-03-10 12:10  lozhu  Views(578)  Comments(0Edit  收藏  举报