kootenpv / yagmail

Send email in Python conveniently for gmail using yagmail
MIT License
2.66k stars 265 forks source link

why it say 'socket.error: [Errno 10060]' ? #93

Open kxltsuper opened 7 years ago

kxltsuper commented 7 years ago

import yagmail yag = yagmail.SMTP('username@gmail.com', 'password') yag.send('kxltsuper@yeah.net', 'subject','This is the body')


File "C:/Users/ADMIN/PycharmProjects/ceshiRedis/csSendEmail.py", line 6, in yag = yagmail.SMTP('username@gmail.com', 'password') File "C:\Python27\lib\site-packages\yagmail\sender.py", line 78, in init self.login(password) File "C:\Python27\lib\site-packages\yagmail\sender.py", line 192, in login self.smtp = self.connection(self.host, self.port, **self.kwargs) File "C:\Python27\lib\smtplib.py", line 801, in init SMTP.init(self, host, port, local_hostname, timeout) File "C:\Python27\lib\smtplib.py", line 256, in init (code, msg) = self.connect(host, port) File "C:\Python27\lib\smtplib.py", line 316, in connect self.sock = self._get_socket(host, port, self.timeout) File "C:\Python27\lib\smtplib.py", line 806, in _get_socket new_socket = socket.create_connection((host, port), timeout) File "C:\Python27\lib\socket.py", line 575, in create_connection raise err socket.error: [Errno 10060]


thank you.

kootenpv commented 7 years ago

That's most likely not an error related to yagmail, but related to your connection. Google that error.

ghost commented 7 years ago

I have/had the same problem.

This script has worked for me. (Source)

thiscallaname commented 6 years ago

I meet the same problem. It can be solved like this: yag = yagmail.SMTP('emailAddress', 'password', 'SMTPSever')