运行和例子相同的程序,每次都出现下面的错误:
在此插入代码
From:1092640073@qq.com Password:** To:liuchao_824@163.com SMTP server:mail.qq.com send: 'ehlo [121.249.213.205]\r\n' reply: b'250-bizmx6.qq.com\r\n' reply: b'250-SIZE 73400320\r\n' reply: b'250 OK\r\n' reply: retcode (250); Msg: b'bizmx6.qq.com\nSIZE 73400320\nOK' Traceback (most recent call last): File "C:\Users\liuchao\Desktop\email\smtp_email2.py", line 24, in <module> server.starttls() File "C:\Python34\lib\smtplib.py", line 673, in starttls raise SMTPException("STARTTLS extension not supported by server.") smtplib.SMTPException: STARTTLS extension not supported by server.
注意读错误信息:raise SMTPException("STARTTLS extension not supported by server.")
QQ邮箱不支持TLS加密
SMTP Server那mail.qq.com换成smtp.qq.com就行
在
server.login()
前面应加上一句
smtp.starttls()
You need a call to starttls() before you login
不好意思,应该是
server.starttls()
Sign in to make a reply
一路向北不搁浅
运行和例子相同的程序,每次都出现下面的错误:
From:1092640073@qq.com Password:** To:liuchao_824@163.com SMTP server:mail.qq.com send: 'ehlo [121.249.213.205]\r\n' reply: b'250-bizmx6.qq.com\r\n' reply: b'250-SIZE 73400320\r\n' reply: b'250 OK\r\n' reply: retcode (250); Msg: b'bizmx6.qq.com\nSIZE 73400320\nOK' Traceback (most recent call last): File "C:\Users\liuchao\Desktop\email\smtp_email2.py", line 24, in <module> server.starttls() File "C:\Python34\lib\smtplib.py", line 673, in starttls raise SMTPException("STARTTLS extension not supported by server.") smtplib.SMTPException: STARTTLS extension not supported by server.