Мой код:
import smtplib
server = smtplib.SMTP("smtp.gmail.com",587) #587-> port no
##ALLOWED: https://www.google.com/settings/lesssecureapps
server.starttls()
print("Connected with Gmail Server")
pwd = open("pass.txt").read()
server.login("prateeek.hitman007@gmail.com",pwd)
server.sendmail("prateeek.hitman007@gmail.com","prateekpriyadarshi1328@gmail.com","I miss you
Prateek")
Следующий вывод:
Connected with Gmail Server
Traceback (most recent call last):
File "E:/Python Edufavrica/Day11/email_backend.py", line 23, in <module>
server.login("prateeek.hitman007@gmail.com",pwd)
File "C:\Users\Prateek Priyadarshi\AppData\Local\Programs\Python\Python36-32\lib\smtplib.py", line 730, in login
raise last_exception
File "C:\Users\Prateek Priyadarshi\AppData\Local\Programs\Python\Python36-32\lib\smtplib.py", line 721, in login
initial_response_ok=initial_response_ok)
File "C:\Users\Prateek Priyadarshi\AppData\Local\Programs\Python\Python36-32\lib\smtplib.py", line 642, 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 h14sm7287809pfq.46 - gsmtp')
Пожалуйста, помогите мне в решении этой ошибки !!