I got a problem with my python program. I Have entered the correct information about my email and password the program and the error is shown below
import smtplib, SSL email="[email protected]" password="my password" port = 465 context = ssl.create_default_context() server =smtplib.SMTP_SSL("smtp.gmail.com",port,context=context) server.login(email,password) message=" Hi I Am Belgin Android " sender_mail=email, receiver_email="[email protected]" server.sendmail(sender_mail,receiver_email,message) Error:
Traceback (most recent call last): File "c:/Users/Belgin/Desktop/Python Coding/email_sending.py", line 10, in <module> server.login(email,password) File "G:\Python\lib\smtplib.py", line 734, in login raise last_exception File "G:\Python\lib\smtplib.py", line 723, in login (code, resp) = self.auth( File "G:\Python\lib\smtplib.py", line 646, in auth raise SMTPAuthenticationError(code, resp) 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 f21sm2590687pfn.71 - gsmtp')
sslinstead ofSSL) after creating an app specific password at myaccount.google.com/apppasswords and everything just worked..