#前提・実現したいこと
rails5で開発をしています。
gandi.netで独自ドメインを取得したので、通知などを行うメールのSMTP設定を新しいアドレスに変更しようとしています。
ユーザー登録周りはdeviseを使用して実装しています。
参考記事:Home > Gandi Mail > GandiMail FAQ > rubymailer
#発生している問題
config/environments/development.rb
のsmtp設定部分を書き換えたのですが、以前設定したアドレスからそのまま通知が届いてしまいます。
サーバーの再起動を行っても変わらず、試しにconfig/environments/production.rb
も書き換えた上でherokuにあげてみましたが、そちらでも変化がありませんでした。
#該当のソースコード
ruby
1Rails.application.configure do 2 # Settings specified here will take precedence over those in config/application.rb. 3... 4 5 # Don't care if the mailer can't send. 6 config.action_mailer.raise_delivery_errors = true 7 8 config.action_mailer.perform_caching = false 9 10 # SMTP Settings 11 config.action_mailer.delivery_method = :smtp 12 13 # config.action_mailer.smtp_settings = { 14 # address: 'smtp.gmail.com', 15 # port: 587, 16 # domain: 'heroku.com', 17 # user_name: ENV['USER_NAME_GMAIL'], 18 # password: ENV['PASSWORD_GMAIL'], 19 # authentication: 'plain', 20 # enable_starttls_auto: true 21 # } 22 23#上記のgmailを使用していたものを、下記に書き換えました。 24 25 config.action_mailer.smtp_settings = { 26 address: 'mail.gandi.net', 27 port: 587, 28 domain: ENV['DOMAIN'], 29 user_name: ENV['USER_NAME_GANDI'], 30 password: ENV['PASSWORD_GANDI'], 31 authentication: 'plain', 32 enable_starttls_auto: true 33 } 34 35 ... 36 # mailer setting for devise 37 config.action_mailer.default_url_options = { host: 'localhost', port: 3000 } 38end 39
#使用している環境
Ruby on Rails 5
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。