7
4

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 5 years have passed since last update.

SES経由のメール送信で554 Message rejected: Email address is not verified. と言われました。

Posted at

RailsでSES経由でメールを送信しようとしています。Deviseからメールアドレス認証メールの送信です。

メール送信でエラー

deviseのユーザー登録画面で、http://localhost:3000/users/sign_upからメールアドレスを入れてsubmitします。

メール送信でエラー
Net::SMTPFatalError in Users::RegistrationsController#create

554 Message rejected: Email address is not verified. The following identities failed the check in region US-WEST-2: please-change-me-at-config-initializers-devise@example.com

メールアドレスをverifiedしてないと言われます。
あれオカシイなーSESの画面からは送信できたのですが。。とおもったらconfig-initializers-deviseと書いてあります。

devise.rbのconfig.mailer_senderを指定

config/initializers/devise.rbを確認するとplease-change-me-at-config-initializers-devise@example.comというところがあったので変更します。

送信メールアドレスを指定
# こうなっているのを
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
# こっちに変更
config.mailer_sender = '送信したいメールアドレス'

SESで認証済みのメールアドレスに変更しました。

再度メール送信

今度はメールが送信できました(☝ ՞ਊ ՞)

7
4
0

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
7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?