Skip to content
Advertisement

How to fix ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056)?

I am trying to send an email with python, but it keeps saying ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1056). Here is my code:

JavaScript

Do you know what is wrong?

Advertisement

Answer

The port for SSL is 465 and not 587, however when I used SSL the mail arrived to the junk mail.

For me the thing that worked was to use TLS over regular SMTP instead of SMTP_SSL.

Note that this is a secure method as TLS is also a cryptographic protocol (like SSL).

JavaScript

provided thanks to the real python tutorial.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement