0

I am getting the below error when I am trying to send an email to a user. It is working fine in localhost, but after deploying it to Heroku I am getting this error. My less secure app is turned on.

SMTPAuthenticationError at /members/register
(534, b'5.7.14 <https://accounts.google.com/signin/continue?sarp=1&scc=1&plt=AKgnsbt\n5.7.14 iREvsLOCGsSdIvQozvsLAI32usRkAKeN9zrVcpG8_5BPTE8Cid59meSrouoFeVL7uexVM\n5.7.14 9BeaQ5gSKAKohzILe4Nqyrn_p3OJhBZJVuJ3Nb36rtmD2h_Rb7TCpJRB6xMw87Ow>\n5.7.14 Please log in via your web browser and then try again.\n5.7.14  Learn more at\n5.7.14  https://support.google.com/mail/answer/78754 n7sm3256692wro.68 - gsmtp')

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 = 'myemail@gmail.com'
EMAIL_HOST_PASSWORD = 'password'
SERVER_EMAIL = EMAIL_HOST_USER
Sumithran
  • 6,217
  • 4
  • 40
  • 54
  • Check this answer https://stackoverflow.com/a/32302040/14457833 I'll suggest not to use personal gmail account for email sending it's insecure and sometime it give error you can try third party services to send email like https://sendgrid.com/ – Ankit Tiwari Dec 08 '21 at 17:26
  • @AnkitTiwari, thank you for your suggestion I'll surely check sendgrid, and the unlock captcha als worked for me, thank you for the answer too. – Ritankar Bhattacharjee Dec 08 '21 at 17:36

0 Answers0