I believe this error is about ENV API Key. This works fine on my localhost but on server.
I added my API key to Components / Environment Variables:
and my development.rb file. as below:
config.action_mailer.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
:address => "smtp.sendgrid.net",
:port => "587",
:authentication => :plain,
:user_name => 'apikey',
:password => ENV['SENDGRID_API_KEY']
}
And I still get the error as below
Errno::ECONNREFUSED (Connection refused - connect(2) for "localhost" port 25):
ARGH! Wasted 2 days on this. All I have to do was adding the Actionmailer settings to
production.rb
I had it only in development.rb file before. Duh!!