Home>

I want to send a letter from one email to another. Run this code

Import SMTPLIB
sender= "" # here i entered my email and password
recipient= ""
password= ""
Subject= "Test letter from Python"
Text= "Hello From Python"
SMTP_SERVER= SMTPLIB.SMTP_SSL ("smtp.gmail.com", 465)
SMTP_SERVER.LOGIN (Sender, Password)
Message= "Subject: {} \ n \ n {}". Format (Subject, Text)
SMTP_SERVER.Sendmail (Sender, Recipient, Message)
SMTP_SERVER.CLOSE ()

and I crawl around 10 stitching smtplib.smtpauthenticationerror: (535, B'5.7.8 UserName and Password Not Accepted. Learn more at \ N5.7.8 https://support.google.com/mail/?p=Badcredentials G11SM170351LFV.9 -GSMTP ') Although the password I pointed out the correct one.