0
I am learning to send emails with python. Early on, I came across an import error of the methods of the smtplib module, which generated this question:
Import error when sending simple email with python
Then I saw that there was no import error when typing command by command on the python command line. However, another error occurred. These are the commands I type line by line:
from smtplib import SMTP_SSL
server=SMTP_SSL('smtp.live.com',465)
On this second line, the following error occurs:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
server=SMTP_SSL('smtp.live.com',465)
File "C:\Users\Benedito\AppData\Local\Programs\Python\Python35-32\lib\smtplib.py", line 1021, in __init__
source_address)
File "C:\Users\Benedito\AppData\Local\Programs\Python\Python35-32\lib\smtplib.py", line 251, in __init__
(code, msg) = self.connect(host, port)
File "C:\Users\Benedito\AppData\Local\Programs\Python\Python35-32\lib\smtplib.py", line 335, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "C:\Users\Benedito\AppData\Local\Programs\Python\Python35-32\lib\smtplib.py", line 1027, in _get_socket
self.source_address)
File "C:\Users\Benedito\AppData\Local\Programs\Python\Python35-32\lib\socket.py", line 711, in create_connection
raise err
File "C:\Users\Benedito\AppData\Local\Programs\Python\Python35-32\lib\socket.py", line 702, in create_connection
sock.connect(sa)
OSError: [WinError 10013] Foi feita uma tentativa de acesso a um soquete de uma maneira que é proibida pelas permissões de acesso
How do I fix this error? Does anyone have any scrit that works that sends email with python?
Unfortunately, the administrator permission did not fix the problem. I disabled Antivirus and also got no result. Python
– Benedito
@Benedito how is windows update? Tried to reinstall Python in the "program files" (Programs And Files) as I mentioned?
– Guilherme Nascimento
I installed Python by default, so he put himself in this folder. But I’ve been using it for a while and it never bothered him to be in this folder. And it is released by Firewall as well. In fact, I was able to send e-mail via TLS, using the smtplib.SMTP.method. Only this smtplib.SMTP_SSL is giving error.
– Benedito
Automatic updates always active, to download and install.
– Benedito
@Benedito I am almost sure that the address smtp.live.com only accepts TLS and not SSL.
– Guilherme Nascimento
And you know some that’s accepted?
– Benedito
@Benedito I believe that most today use the TLS, but for the sake of conscience it would be nice to check if your Python has SSL installed.
– Guilherme Nascimento