我使用allauth并希望发送验证电子邮件。
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
EMAIL_USE_TLS = True
EMAIL_HOST = 'smtp.ionos.com'
EMAIL_HOST_USER = 'info@mydomain.com'
EMAIL_HOST_PASSWORD = 'secretpassword'
EMAIL_PORT = 587
我使用Ionos,浏览器中显示的错误:
SMTPAuthenticationError at /accounts/signup/
(535, b'Authentication credentials invalid')
Request Method: POST
Request URL: http://127.0.0.1:8000/accounts/signup/
Django Version: 4.0.1
Exception Type: SMTPAuthenticationError
Exception Value:
(535, b'Authentication credentials invalid')
凭据是正确的,也许密码编码有错误,或者我做得完全错误。我在django后端需要任何smtp客户端吗?
我不得不更改端口和TLS,所以SSL现在可以工作了
EMAIL_USE_SSL = True
EMAIL_HOST = 'smtp.ionos.com'
EMAIL_HOST_USER = 'info@mydomain.com'
EMAIL_HOST_PASSWORD = 'secretpassword'
EMAIL_PORT = 465