Make sure you using your rails console in production mode.
rails console production
문제
I am running into a very strange problem.
My /config/environments/production.rb file has the following =>
ActionMailer::Base.smtp_settings = {
:address => 'smtp.sendgrid.net',
:port => 587,
:domain => "domain.com",
:user_name => "username",
:password => "password",
:authentication => 'plain',
:enable_starttls_auto => true }
I've restarted the app (currently using Passenger and Nginx), but when I go into Rails Console I get the following =>
[30] pry(main)> ActionMailer::Base.smtp_settings
{
:address => "localhost",
:port => 25,
:domain => "localhost.localdomain",
:user_name => nil,
:password => nil,
:authentication => nil,
:enable_starttls_auto => true
}
Anyone ever experience this ? This is the root problem for me not being able to send email out. I get connection refused since it is not loading the proper settings. Any thoughts I am banging my heard against the wall ><
해결책
Make sure you using your rails console in production mode.
rails console production