Open jmdahling opened 7 years ago
Here's how I tested and discovered this:
import smtplib smtp = smtplib.SMTP(timeout=5) smtp.connect('smtp.gmail.com') Traceback (most recent call last): File "
", line 1, in File "/usr/lib/python2.7/smtplib.py", line 316, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/lib/python2.7/smtplib.py", line 291, in _get_socket return socket.create_connection((host, port), timeout) File "/usr/lib/python2.7/socket.py", line 575, in create_connection raise err socket.timeout: timed out smtp = smtplib.SMTP(port=587, timeout=5) smtp.connect('smtp.gmail.com') Traceback (most recent call last): File " ", line 1, in File "/usr/lib/python2.7/smtplib.py", line 316, in connect self.sock = self._get_socket(host, port, self.timeout) File "/usr/lib/python2.7/smtplib.py", line 291, in _get_socket return socket.create_connection((host, port), timeout) File "/usr/lib/python2.7/socket.py", line 575, in create_connection raise err socket.timeout: timed out smtp.connect('smtp.gmail.com', port=587) (220, 'smtp.gmail.com ESMTP o189sm28894377pga.12 - gsmtp')
smtplib.SMTP_SSL
should be used first, and then smtplib.SMTP
.
Hello,
Is there any plan to fix this issue?. I've the same issue because some cloud providers block port 25 (like FCP for example), and then the script is unable to connect.
Thanks!
I got the same Issue when using AWS lambda. So I contacted support and then they removed port 25 throttle. I think that was only way
This happens to any customers using xfinity for example - see: https://www.xfinity.com/support/internet/email-port-25-no-longer-supported/
Recommend that the script be updated to utilize port 587 to avoid additional bugs due to return of "None"