SESメール送信 S3で受信テスト

# 概要

:::note
* SESで独自ドメインのメール送信テストしたい
* 受信確認メール環境作るのだるい
* SESのメール受信機能使う、受信環境はS3
* 正常に送信するかだけを確認するメモ
:::

# 前提

:::note
* ドメインは取得済み＆登録済みであること(Route53で取得した）
* SESのリージョンはUS.East(SESメール受信は東京リージョンでできないため)
:::

# 詳細

## ドメイン認証

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/6cf71e1f-a619-648c-cfbe-8528320c6f49.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/16e7795e-38ec-3489-6410-9eb832373742.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/85fb3b85-69f6-7e41-99cb-2e9b1d719a8c.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/75cd8d97-ac83-9a78-2420-c7da5fcc439f.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/9199709f-0763-eb32-c5c4-f0c5dfcb1e63.png)

* Route53で以下のように登録

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/db9cb744-0386-e3df-83a3-80dbdf038ea7.png)

* ドメイン認証された

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/e2ff2d97-7688-a373-6ff6-2eef6c031c90.png)


## メール送信受信設定

* Email receiving ➔ Create rule set

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/956e7b60-7c2c-4bf0-23c8-18e6c1e4d893.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/18eaaf5a-5863-ae4b-6356-56beff8089ff.png)

* Create rule

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/84ba69b9-74d8-c652-fac2-484c972ab158.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/946cf8b4-8c9e-4d7c-abe9-79677225adda.png)

* Add new recipient condition

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/392692af-b3cc-c5f6-379c-b0d77d936d8e.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/bb0f5ce8-d0c4-e183-7603-8f2c8d60e971.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/9e7f1483-6645-51c0-0fe7-6e9c8c12f705.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/880c8e02-3103-85d7-371f-d2bda1fb611b.png)

* Review ➔ Create rule

* S3バケット確認

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/98890ab3-22cb-02ea-e80d-5a4da829d12b.png)


* Set as active

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/1f797e5b-717a-00f4-c92a-f5a5cc7104d3.png)

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/dd60f577-8a37-3864-2bc1-80dec7481e8a.png)

## メール送信受信実行

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/24a80cfe-66de-16f3-a461-4fb23e1febb4.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/cbfcd6c1-6bd2-4972-4371-17130496156c.png)


![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/5b1685ac-c76b-40c9-9bc2-5c42ffbd6b5e.png)


Send test email

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/dda0e1f5-970a-0705-1438-6a8fe8ecab30.png)

* 以下のようなメールが届いている

![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/57350/c4648aad-ee98-3c6c-6533-044bef478663.png)

# 参考

* [公式](https://docs.aws.amazon.com/ja_jp/ses/latest/dg/receiving-email-setting-up.html)

# 感想

* 送信テストが受信までお手軽にできて非常に良い
* UIが洗練されていない。他のサービスにくらべSESはどこに何があるか分かりづらいのが難点。