ActionMailer failed while using SMTP in production mode
Rails 7.0.1 I have tried and successed of ActionMailer in development environment, however it doesn't work in production enviroment. It seemed th开发者_高级运维at I am not able to receive the mail that I sent.
Here is the success(able to send mail) code of ActionMailer in config/environments/development.rb
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_caching = false
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: '157.xxx.xxx.xxx',
port: 25,
authentication: :plain,
enable_starttls_auto: false
}
config.action_mailer.perform_deliveries = true
config.action_mailer.default_options = {from: 'hogehoge@example.com'}
Here is the failed(not able to send mail) code of ActionMailer in config/environment/production.rb after adding sidekiq and redis
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_caching = false
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
port: 25,
address: '157.xxx.xxx.xxx', #same as development one
authentication: :plain,
enable_starttls_auto: false
}
config.action_mailer.perform_deliveries = true
config.action_mailer.default_options = {from: 'hogehoge@example.com'}
Except raise_delivery_errors, everything remains in config/enviroment between development and production. Is there any place needs to be fix except config while turning into production? Thanks in advance.
精彩评论