本番環境をherokuからawsに変更し、デプロイしました。
メール送信も、sendgirdからgmailに変更したいと考えています。
アプリのページは表示されているのですが、新規ユーザーの登録をする際に、アカウント有効化メールを送信しようとすると、エラーになります。
config/environments/production.rb config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :smtp config.action_mailer.default_url_options = { host: "EIP" } ActionMailer::Base.smtp_settings = { :address => 'smtp.gmail.com', :port => '587', :authentication => :plain, :user_name => 'hogehoge@gmail.com', :password => '{アプリパスワード}', }
application_mailer.rb class ApplicationMailer < ActionMailer::Base default from: 'hogehoge@example.com' layout 'mailer' end
エラーコード D, [2020-01-07T04:01:56.490187 #3790] DEBUG -- : [969eb332-a24e-4219-bdb1-73d9d64ddcaa] ^[[1m^[[36mUser Create (0.4ms)^[[0m ^[[1m^[[32mINSERT INTO `users` (`name`, `email`, `created_at`, `updated_at`, `password_digest`, `activation_digest`) VALUES ('あいうえお', 'hogeeehoge@gmail.com', '2020-01-07 04:01:56', '2020-01-07 04:01:56', '$2a$12$Q14WSE82Aaalnp5DgiYZ1.0rfwt5LYapFMtPscqbFJSPELUbdgL6G', '$2a$12$bm8JiJYl74Z2rS6xYGPbsOoqDQ4ewb9FrIsR1GzCgeOsET/.ZMiw6')^[[0m D, [2020-01-07T04:01:56.492531 #3790] DEBUG -- : [969eb332-a24e-4219-bdb1-73d9d64ddcaa] ^[[1m^[[35m (1.9ms)^[[0m ^[[1m^[[35mCOMMIT^[[0m I, [2020-01-07T04:01:56.493489 #3790] INFO -- : [969eb332-a24e-4219-bdb1-73d9d64ddcaa] Rendering user_mailer/account_activation.html.erb within layouts/mailer I, [2020-01-07T04:01:56.493850 #3790] INFO -- : [969eb332-a24e-4219-bdb1-73d9d64ddcaa] Rendered user_mailer/account_activation.html.erb within layouts/mailer (Duration: 0.3ms | Allocations: 65) I, [2020-01-07T04:01:56.494062 #3790] INFO -- : [969eb332-a24e-4219-bdb1-73d9d64ddcaa] Rendering user_mailer/account_activation.text.erb within layouts/mailer I, [2020-01-07T04:01:56.494261 #3790] INFO -- : [969eb332-a24e-4219-bdb1-73d9d64ddcaa] Rendered user_mailer/account_activation.text.erb within layouts/mailer (Duration: 0.1ms | Allocations: 48) D, [2020-01-07T04:01:56.495613 #3790] DEBUG -- : [969eb332-a24e-4219-bdb1-73d9d64ddcaa] UserMailer#account_activation: processed outbound mail in 2.7ms I, [2020-01-07T04:01:57.429652 #3790] INFO -- : [969eb332-a24e-4219-bdb1-73d9d64ddcaa] Delivered mail 5e1402b47930f_ece189c26067@ip-10-0-5-10.mail (933.9ms) D, [2020-01-07T04:01:57.429748 #3790] DEBUG -- : [969eb332-a24e-4219-bdb1-73d9d64ddcaa] Date: Tue, 07 Jan 2020 04:01:56 +0000^M From: noreply@example.com^M To: hogeeehoge@gmail.com^M Message-ID: <5e1402b47930f_ece189c26067@ip-10-0-5-10.mail>^M Subject: =?UTF-8?Q?=E3=83=9E=E3=83=83=E3=82=B9=E3=81=82=E3=81=A3=E3=81=B7=E3=81=B8=E3=82=88=E3=81=86=E3=81=93=E3=81=9D=E3=80=82=E4=B8=8B=E8=A8=98=E3=81=AE=E3=83=AA=E3=83=B3=E3=82=AF=E3=82=92=E3=82=AF=E3=83=AA=E3=83=83=E3=82=AF=E3=81=97=E3=81=A6=E3=80=81=E6=9C=AC=E7=99=BB=E9=8C=B2=E3=82=92=E5=AE=8C=E4=BA=86=E3=81=95=E3=81=9B=E3=81=A6=E3=81=8F=E3=81=A0=E3=81=95=E3=81=84=E3=80=82?=^M Mime-Version: 1.0^M Content-Type: multipart/alternative;^M boundary="--==_mimepart_5e1402b478c36_ece189c2591e";^M charset=UTF-8^M Content-Transfer-Encoding: 7bit^M ^M ^M ----==_mimepart_5e1402b478c36_ece189c2591e^M Content-Type: text/plain;^M charset=UTF-8^M Content-Transfer-Encoding: base64^M ^M 44GC44GE44GG44GI44GK5qeYDQoNCuODnuODg+OCueOBguOBo+OBt+OBuOOC^M iOOBhuOBk+OBneOAguS4i+iomOOBruODquODs+OCr+OCkuOCr+ODquODg+OC^M r+OBl+OBpuOAgeacrOeZu+mMsuOCkuWujOS6huOBleOBm+OBpuOBj+OBoOOB^M leOBhOOAgg0KaHR0cDovL3RyYW5xdWlsLXNwcmluZ3MtMzMyMTQuaGVyb2t1^M YXBwLmNvbS9hY2NvdW50X2FjdGl2YXRpb25zL1dxOEJlSXgtS3FORk5kTlpV^M Sms4bGcvZWRpdD9lbWFpbD1ob2dlZWVob2dlJTQwZ21haWwuY29tDQoNCg==^M ^M ----==_mimepart_5e1402b478c36_ece189c2591e^M Content-Type: text/html;^M charset=UTF-8^M Content-Transfer-Encoding: base64^M ^M PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCiAgPGhlYWQ+DQogICAgPG1ldGEg^M aHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7^M IGNoYXJzZXQ9dXRmLTgiIC8+DQogICAgPHN0eWxlPg0KICAgICAgLyogRW1h^M aWwgc3R5bGVzIG5lZWQgdG8gYmUgaW5saW5lICovDQogICAgPC9zdHlsZT4N^M CiAgPC9oZWFkPg0KDQogIDxib2R5Pg0KICAgIDxoMT7jg57jg4PjgrnjgYLj^M gaPjgbc8L2gxPg0KPHA+44GC44GE44GG44GI44GK5qeYPC9wPg0KPHA+44Oe^M 44OD44K544GC44Gj44G344G444KI44GG44GT44Gd44CC5LiL6KiY44Gu44Oq^M 44Oz44Kv44KS44Kv44Oq44OD44Kv44GX44Gm44CB5pys55m76Yyy44KS5a6M^M 5LqG44GX44Gm44GP44Gg44GV44GE44CCPC9wPg0KPGEgaHJlZj0iaHR0cDov^M L3RyYW5xdWlsLXNwcmluZ3MtMzMyMTQuaGVyb2t1YXBwLmNvbS9hY2NvdW50^M X2FjdGl2YXRpb25zL1dxOEJlSXgtS3FORk5kTlpVSms4bGcvZWRpdD9lbWFp^M bD1ob2dlZWVob2dlJTQwZ21haWwuY29tIj7oqo3oqLzjgZnjgos8L2E+DQoN^M CiAgPC9ib2R5Pg0KPC9odG1sPg0K^M ^M ----==_mimepart_5e1402b478c36_ece189c2591e--^M I, [2020-01-07T04:01:57.429963 #3790] INFO -- : [969eb332-a24e-4219-bdb1-73d9d64ddcaa] Completed 500 Internal Server Error in 1543ms (ActiveRecord: 2.7ms | Allocations: 6238) F, [2020-01-07T04:01:57.430495 #3790] FATAL -- : [969eb332-a24e-4219-bdb1-73d9d64ddcaa] [969eb332-a24e-4219-bdb1-73d9d64ddcaa] Net::SMTPFatalError (550 Unauthenticated senders not allowed ): [969eb332-a24e-4219-bdb1-73d9d64ddcaa] [969eb332-a24e-4219-bdb1-73d9d64ddcaa] app/controllers/users_controller.rb:24:in `create'
エラーで気になるのは、 Net::SMTPFatalError (550 Unauthenticated senders not allowed の部分と、
application_mailer.rbで default from: 'hogehoge@example.com'に変更しているにもかかわらず、
from noreply@example.com になってしまうところです。
エラーの原因が分かる方、いらっしゃいませんか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。