Home > Software design >  Email backend for django application not working
Email backend for django application not working

Time:08-01

I tried to use the usual way of having my gmail account send user activation email to used but it keep failing. Please is there any new changes made to Django or Gmail that is preventing this and how do I work around it. Please see below for the error detail:

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 s2-20020a05620a29c200b006af0ce13499sm6006618qkp.115 - gsmtp')

CodePudding user response:

You would need to generate app passwords to use them in your account. Check out the google support page here

CodePudding user response:

I enabled App Password and used it in settings to access my account. Everything works fine now

CodePudding user response:

Following this Steps

Create & use App Passwords

for

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_USE_TLS = True
EMAIL_PORT = 587
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD  = 'prposomwfmwyghhe'
DEFAULT_FROM_EMAIL  = 'ShopY Business <[email protected]>'

If you use 2-Step-Verification and get a "password incorrect" error when you sign in, you can try to use an App Password.

  1. Go to your Google Account.
  2. Select Security.
  3. Under "Signing in to Google," select App Passwords. You may need to sign in. If you don’t have this option, it might be because:
  • 2-Step Verification is not set up for your account.
  • 2-Step Verification is only set up for security keys.
  • Your account is through work, school, or other organizations.
  • You turned on Advanced Protection.
  1. At the bottom, choose Select app and choose the app you using and then Select device and choose the device you’re using and then Generate.

  2. Follow the instructions to enter the App Password. The App Password is the 16-character code in the yellow bar on your device.

Example 16-character keycode :

prpo somw fmwy ghhe

Tap Done.

  • Related