SMTP Authentication Error with Django on Heroku
Disabling CAPTCHA for clients
If you are not using 2-factor authentication and you have verified the credentials in your Python source are correct, follow these steps:
- Login to gmail in your browser
- Navigate to the DisplayUnclockCaptcha page.
Click the continue button, and you will see the message
Account access enabled Please try signing in to your Google account again from your new device or application.
Run your Python script - your login attempt should be successful.
Try using sendgrid, because gmail smtp has some problem. I too was unable to do using gmail smtp. But it worked perfectly using sendgrid. And this is also free for basic use.
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'EMAIL_HOST = 'smtp.sendgrid.net'EMAIL_HOST_USER = 'username'EMAIL_HOST_PASSWORD = 'userpassword'EMAIL_PORT = 587EMAIL_USE_TLS = TrueDEFAULT_FROM_EMAIL = 'asdf@example.com'