2
私のdjangoアプリケーションを使用して電子メールを送信しようとしています。しかし、Zohoアカウントを設定してsettings.pyに必要な行を追加した後も、私はまだメールを送信することはできません。SMTPAuthenticationError(535、b'Authentication Failed ')。その理由のDjangoでZoho smtpを使用した認証に失敗しました
#settings.py
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.zoho.com'
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'mypass'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
#views.py
html = render_to_string('email/code_email.html',{'code':code})
send_mail('Your Code',
'Hello',
'[email protected]',
['[email protected]'],
html_message=html
)
return render(request,'index.html')
あなたは解決策を見つけましたか? –