I try to reset password with gmail.com. I think I set everything correct, but it's still doesn't work and raise error like so:
settings.py
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = os.environ.get('EMAIL_USER')
EMAIL_HOST_PASSWORD = os.environ.get('EMAIL_PASS')
I set my enviroment variables EMAIL_USER
(login to my gmail account) and EMAIL_PASS
(16-sign password provided by Google when you use 2-step authentication - Google App Password). I tried also use password to my gmail account but this also not work. Someone know what I do wrong ? Thanks for any help.
import smtplib server = smtplib.SMTP_SSL('smtp.gmail.com', 465) account=os.environ.get('EMAIL_USER') password=os.environ.get('EMAIL_PASS') server.login(account,password)
See if that connects ok – KJTHoward-
) to make it easily readable, but you must not put dashes in your code. – dirkgroten