I have username and password of gmail account, I need API to automatically login to gmail from my python code.
I have tried using smtplib
import smtplib
server = smtplib.SMTP_SSL('smtp.gmail.com', 465)
server.starttls()
username="test@gmail.com"
password="test"
server.login(username, password)
server.quit()
I am getting smtplib.SMTPAuthenticationError error