Arundeep Chohan
Arundeep Chohan

Reputation: 9969

AWS SES Setup with Django

I am trying to add AWS SES into my project. Where I get a different region listed

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 protected]

In the AWS verified identities it is listed:

[email protected]   Email address   Verified

I have the permissions for the SES for my policy for that user.

Attached from group
 AmazonSESFullAccess
AWS managed policy from group AmazonSESFullAccess

Also my 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 = ''

Where it's used

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

 send_mail(email_subject, email_message,'[email protected]',['[email protected]'])

Upvotes: 0

Views: 1124

Answers (1)

Simon Slominski
Simon Slominski

Reputation: 36

1. Amazon SES sandbox

I'm assuming you're in Sandbox mode, which means you need to add the recipients' email addresses to successfully send the email. You can make a request to exit sandbox mode, then the daily limit of sent emails will increase and you will not have to define them.

More on this topic can be found here: https://docs.aws.amazon.com/ses/latest/dg/request-production-access.html

2. New settings with TLS

The second option is to check if the mail works with TLC settings:

Example settings:

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 = '[email protected]'     # You need to verify this mail

Upvotes: 1

Related Questions