0

我有一个 Web 应用程序,我希望能够在需要时向任何用户发送自动电子邮件。我正在对其进行测试,一切似乎都很好,但我注意到收件人电子邮件没有收到任何消息。下面是我在settings.py文件中的配置。

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'beaubien.web-dns1.com'
EMAIL_PORT = 465
EMAIL_HOST_USER = 'med.abdillah@massiwatechnology.com'
EMAIL_HOST_PASSWORD = '###########'
EMAIL_USE_SSL = True
EMAIL_USE_TLS = False

这是views.py文件。

def send_email(request):
    send_mail('Bonjour cher personnel',
              'Hello there,Ceci est un message automatique.',
              'med.abdillah@massiwatechnology.com',
              ['abdillah@buaa.edu.cn'],
              fail_silently=False,
              )
    return render(request, 'courriers/send_email.html')

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Sent!</title>
</head>
<body>
    <h1>Send an email!</h1>
</body>
</html>

请帮助我。提前谢谢你

4

1 回答 1

0

配置很好,但我注意到问题出在收件人的电子邮件地址上。我已经更改了它并使用了另一个电子邮件地址,现在一切都很完美。发送到收件人电子邮件地址的电子邮件被拒绝。

感谢你们。

于 2020-08-15T08:24:40.313 回答