-1

I have enabled my POP and IMAP but still it is throwing an error while logging in to gmail account...Here is my code

import smtplib
host="smtp.gmail.com"
port=587
username="bilalgcu29@gmail.com"
password="xyz"
connection = smtplib.SMTP(host,port)
connection.ehlo()
connection.starttls()
connection.login(username,password)

The error is raise SMTPAuthenticationError(code, resp) smtplib.SMTPAuthenticationError: (534, b'5.7.14 ....)

  • Possible duplicate of [How to send an email with Gmail as provider using Python?](https://stackoverflow.com/questions/10147455/how-to-send-an-email-with-gmail-as-provider-using-python) – tripleee Aug 09 '18 at 09:12

1 Answers1

0

I got my answer by going to this link and turned it ON https://www.google.com/settings/security/lesssecureapps