I
I
ilya_ya2018-02-02 22:50:14
Python
ilya_ya, 2018-02-02 22:50:14

Can't connect to smtp server. What to do?

Hello. I decided to automate sending email in python. Gives this error
Python 3.5.4 (v3.5.4:3f56838, Aug 8 2017, 02:07:06) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license() "for more information.
>>> import smtplib
>>> smtpObj = smtplib.SMTP('smtp.gmail.com', 587)
Traceback (most recent call last):
File "", line 1, in
smtpObj = smtplib.SMTP('smtp.gmail .com', 587)
File "C:\Users\admin\AppData\Local\Programs\Python\Python35-32\lib\smtplib.py", line 254, in __init__
raise SMTPConnectError(code, msg)
smtplib.SMTPConnectError: (421, b'Cannot connect to SMTP server ***** (******),
How to fix?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question