0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

DjangoでAmazon SESを使用したとき発生した500エラーの解決方法

Posted at

EC2を使ってDjangoアプリをデプロイし、その中のメール送信フォームからメールを送信したところ500エラーが発生した。
メール送信にはAmazon SESを使用していて、サンドボックスは解除済みである。
エラー文を見ると、

botocore.errorfactory.MessageRejected: 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: [メールアドレス]

と書かれていた。

解決方法

settings.pyに

AWS_SES_REGION_NAME = 'ap-northeast-1'
AWS_SES_REGION_ENDPOINT = 'email.ap-northeast-1.amazonaws.com'

と書き込む。
リージョンは登録したときによって変わる。

0
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?