I set up django email backend following way:
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
# Host for sending e-mail.
EMAIL_HOST = 'mytdl.de'
# Port for sending e-mail.
EMAIL_PORT = 25
# Optional SMTP authentication information for EMAIL_HOST.
EMAIL_HOST_USER = 'me@mytdl.de'
EMAIL_HOST_PASSWORD = config('EMAIL_HOST_PASSWORD')
But sending emails with django-allauth will return following error:
(535, b'5.7.8 Error: authentication failed: authentication failure')
Testing the the settings with
telnet mytdl.de 25
or Thunderbird as email client works fine.
2.7.0 Authentication successful
But Django / SMTP stills throws that error. Django also tries to
AUTH CRAM-MD5
and not
AUTH LOGIN
any ideas?
If your email host is gmail then you can fix it with these simple steps:
Also maintain your settings variables in this order:
settings.py
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = 'example@gmail.com'
EMAIL_HOST_PASSWORD = 'mypassword'
EMAIL_PORT = 587
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.