【问题标题】:AWS SES Setup with Django使用 Django 设置 AWS SES
【发布时间】:2022-06-29 16:04:03
【问题描述】:

我正在尝试将 AWS SES 添加到我的项目中。我在哪里列出了不同的地区

MessageRejected at /
An error occurred (MessageRejected) when calling the SendRawEmail operation: Email address is not verified. The following identities failed the check in region US-EAST-1: email@hotmail.com

在 AWS 验证的身份中列出:

email@hotmail.com   Email address   Verified

我对该用户的策略具有 SES 权限。

Attached from group
 AmazonSESFullAccess
AWS managed policy from group AmazonSESFullAccess

也是我的 settings.py

EMAIL_BACKEND = 'django_ses.SESBackend'
EMAIL_HOST = 'email-smtp.us-west-2.amazonaws.com'
EMAIL_PORT = 465
EMAIL_USE_SSL = True
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''

在哪里使用

from django.core.mail import send_mail
from django.conf import settings

 send_mail(email_subject, email_message,'email@hotmail.com',['email@hotmail.com'])

【问题讨论】:

    标签: django amazon-web-services amazon-ses


    【解决方案1】:

    1. Amazon SES 沙盒

    我假设您处于沙盒模式,这意味着您需要添加收件人的电子邮件地址才能成功发送电子邮件。您可以提出退出沙盒模式的请求,然后发送电子邮件的每日限制将增加,您不必定义它们。

    可以在此处找到有关此主题的更多信息: https://docs.aws.amazon.com/ses/latest/dg/request-production-access.html

    2。 TLS 的新设置

    第二个选项是检查邮件是否使用 TLC 设置:

    示例设置:

    EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
    EMAIL_HOST = 'email-smtp.<your AWS region>.amazonaws.com'
    EMAIL_PORT = 587
    EMAIL_USE_TLS = True
    EMAIL_HOST_USER = 'smtp_username'.     # IAM user SMTP Credentials
    EMAIL_HOST_PASSWORD = 'smtp_password'  # IAM user SMTP Credentials
    DEFAULT_FROM_EMAIL = 'my@mail.com'     # You need to verify this mail
    

    【讨论】:

      猜你喜欢
      • 2018-07-12
      • 2023-03-19
      • 2017-01-04
      • 1970-01-01
      • 2023-03-10
      • 2017-11-03
      • 1970-01-01
      • 1970-01-01
      • 2021-10-07
      相关资源
      最近更新 更多