python with gmail in windws10 - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Networking (https://python-forum.io/forum-12.html) +--- Thread: python with gmail in windws10 (/thread-32096.html) |
python with gmail in windws10 - mchabane78 - Jan-20-2021 Hi i am using for first time python to send email in my small code and i am getting an error my code is : import smtplib with smtplib.SMTP('smtp.gmail.com',587) as smtp: smtp.ehlo() smtp.starttls() smtp.eclo() smtp.login('[email protected]','XXXXX') subject = 'My first email' body = 'how are you' msg = f'Subject: {subject}\n\n{body}' smtp.sendmail('source','dest', msg) RE: python with gmail in windws10 - snippsat - Jan-21-2021 Line 6 it should be smtp.ehlo() .
RE: python with gmail in windws10 - mchabane78 - Jan-21-2021 Hi issue was with VPN and VPN was not allowing me to send email , after i did disable it it is working fine of course i did change the line 6 . Thanks a lot . |