小编use*_*042的帖子

python 3 smtplib异常:'SSL:WRONG_VERSION_NUMBER'登录到outlook

python 3中的以下代码在我的计算机上引发错误,我不知道如何正确登录:

import smtplib
connection = smtplib.SMTP('smtp-mail.outlook.com', 587)
connection.ehlo()
connection.starttls()
connection.ehlo()
connection.login('_these_dont_matter@outlook.com', '_the_error_persists_')
Run Code Online (Sandbox Code Playgroud)

最后一行产生以下输出:

Traceback (most recent call last):
  File "/usr/lib/python3.3/smtplib.py", line 366, in getreply
    line = self.file.readline()
  File "/usr/lib/python3.3/socket.py", line 297, in readinto
    return self._sock.recv_into(b)
  File "/usr/lib/python3.3/ssl.py", line 460, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/lib/python3.3/ssl.py", line 334, in read
    v = self._sslobj.read(len, buffer)
ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1504)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, …
Run Code Online (Sandbox Code Playgroud)

python outlook openssl imaplib

1
推荐指数
2
解决办法
6262
查看次数

标签 统计

imaplib ×1

openssl ×1

outlook ×1

python ×1