現在、AWSのSESを利用して、お問い合わせメールを送信しようと考えているのですが、awsのSES上のSend a Test Emailからだと送信がされるのですが、サイト上で送信しようとすると、メールが送れない状態にあります。(エラーにはなっていないのですが)
もしわかる方がいらしたら、どうか教えて頂きたいです。
送信ができていない状況にあります
・sending statisticsの件数が増えていません。
console
1I, [2020-09-26T06:51:11.967091 #15083] INFO -- : Rendered customer/confirm.html.erb (14.0ms) 2I, [2020-09-26T06:51:11.967415 #15083] INFO -- : Completed 200 OK in 17ms (Views: 10.8ms | ActiveRecord: 5.8ms) 3I, [2020-09-26T06:51:14.958815 #15081] INFO -- : Started POST "/customer/thanks" for 106.180.1.11 at 2020-09-26 06:51:14 +0000 4I, [2020-09-26T06:51:14.962917 #15081] INFO -- : Processing by CustomerController#thanks as HTML 5I, [2020-09-26T06:51:14.963099 #15081] INFO -- : Parameters: {"utf8"=>"✓", "authenticity_token"=>"GQY4sBOUcWY7Yus23XMd3a1756M9JXYHDXt5MDlVvX+0riBB/oKuzj6MFSemvFhk4W9m/KKu95FNtp49eUXKRg==", "customer"=>{"name"=>"xxxxxxxxx", "email"=>"xxxxxxxxxxx@gmail.com", "about"=>"要件について", "message"=>"Hello"}, "commit"=>"送信する"} 6I, [2020-09-26T06:51:14.978318 #15081] INFO -- : Rendered customer_mailer/received_email.html.erb within layouts/mailer (0.5ms) 7I, [2020-09-26T06:51:14.980623 #15081] INFO -- : Rendered customer_mailer/received_email.text.erb within layouts/mailer (0.4ms) 8D, [2020-09-26T06:51:15.280900 #15081] DEBUG -- : 9CustomerMailer#received_email: processed outbound mail in 312.9ms 10I, [2020-09-26T06:51:15.303467 #15081] INFO -- : 11Sent mail to xxxxxxxxxxxx@gmail.com (22.2ms) 12D, [2020-09-26T06:51:15.303657 #15081] DEBUG -- : Date: Sat, 26 Sep 2020 06:51:15 +0000 13From: info <xxxxxxxxxxxx@wa-campus.com> 14To: info <xxxxxxxxxxx@gmail.com> 15Message-ID: <5f6ee4e346151_3ae91221c0c595dd@ip-10-0-0-42.mail> 16Subject: =?UTF-8?Q?=E3=81=8A=E5=95=8F=E3=81=84=E5=90=88=E3=82=8F=E3=81=9B=E3=82=92=E6=89=BF=E3=82=8A=E3=81=BE=E3=81=97=E3=81=9F?= 17Mime-Version: 1.0 18Content-Type: multipart/alternative; 19 boundary="--==_mimepart_5f6ee4e344362_3ae91221c0c594e6"; 20 charset=UTF-8 21Content-Transfer-Encoding: 7bit 22 23 24----==_mimepart_5f6ee4e344362_3ae91221c0c594e6 25Content-Type: text/plain; 26 charset=UTF-8 27Content-Transfer-Encoding: base64 28 29V2Vi44K144Kk44OI44GL44KJ44GK5ZWP44GE5ZCI44KP44Gb44GM44GC44KK 3044G+44GX44Gf44CCDQogDQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0K 31TmFtZTog55+z5rih5oi444CA57SYDQpFbWFpbDogaG9uZGE3NzA4MTBAZ21h 32aWwuY29tDQpTdWJqZWN0OiDopoHku7bjgavjgaTjgYTjgaYNCk1lc3NhZ2U6 33DQpIZWxsbw0KDQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQ0KDQo= 34 35----==_mimepart_5f6ee4e344362_3ae91221c0c594e6 36Content-Type: text/html; 37 charset=UTF-8 38Content-Transfer-Encoding: quoted-printable 39 40<html>=0D 41 <body>=0D 42 <!doctype html>=0D 43<html lang=3D"ja">=0D 44 <head>=0D 45 <meta content=3D"text/html; charset=3DUTF-8" />=0D 46 </head>=0D 47 <body>=0D 48 <p>Name: =E7=9F=B3=E6=B8=A1=E6=88=B8=E3=80=80=E7=B4=98</p>=0D 49 <p>Email: xxxxxxxxxxxx@gmail.com</p>=0D 50 <p>Subject: =E8=A6=81=E4=BB=B6=E3=81=AB=E3=81=A4=E3=81=84=E3=81=A6</p>= 51=0D 52 <p>Message: Hello</p>=0D 53 <hr />=0D 54 </body>=0D 55</html>=0D 56=0D 57 </body>=0D 58</html>=0D 59 60----==_mimepart_5f6ee4e344362_3ae91221c0c594e6-- 61 62 63```Gemfile 64gem 'aws-ses', '~> 0.6'
/mailers/customer_mailer ```mailer class CustomerMailer < ApplicationMailer default from: "info <xxxxxxxxxx@xxxxxxxxxxx.com>" # 送信元アドレス layout 'mailer' def received_email(customer) @customer = customer mail( to: 'info <xxxxxxxxxxx@gmail.com>', subject: 'お問い合わせを承りました' ) end end
/environments/production.rb
production
1config.action_mailer.raise_delivery_errors = false 2 config.mailer_sender = 'Info <xxxxxxxxxxxxxx@xxxxxxxx.com>' 3 config.action_mailer.default_url_options = { host: 'xxxxxxxxx.com' } 4 config.action_mailer.delivery_method = :ses 5 config.action_mailer.smtp_settings = { 6 7 :server => 'email-smtp.ap-northeast-1.amazonaws.com', 8 :port => 587, 9 :access_key_id => 'xxxxxxxxxxxxxxx', 10 :secret_access_key => 'xxxxxxxxxxxxxxxxxxxxxxxx', 11 :domain => 'xxxxxx.com', 12 :enable_starttls_auto => true 13 }
/initializers/aws.rb
aws
1config.action_mailer.raise_delivery_errors = false 2 config.mailer_sender = 'Info <xxxxxxxxxxx@xxxxxxxxx.com>' 3 config.action_mailer.default_url_options = { host: 'xxxxxx.com' } 4 config.action_mailer.delivery_method = :ses 5 config.action_mailer.smtp_settings = { 6 7 :server => 'email-smtp.ap-northeast-1.amazonaws.com', 8 :port => 587, 9 :access_key_id => 'xxxxxxxxxxxxx', 10 :secret_access_key => 'xxxxxxxxxxxxxxxxxxxxx', 11 :domain => 'xxxxxxxxxx.com', 12 :enable_starttls_auto => true 13 }
あなたの回答
tips
プレビュー