Thursday, February 26, 2009

Errno::ECONNREFUSED: Connection refused - connect(2)

Errno::ECONNREFUSED: Connection refused - connect(2)

If you get this error, one of the reason could be incorrect or no ActionMailer settings. The following structure needs to be present in your production.rb (or whatever config file):

ActionMailer::Base.smtp_settings = {
:address => 'smtp.gmail.com',
:port => 587,
:domain => 'mydomain.com',
:authentication => :plain,
:user_name => 'user@mydomain.com',
:password => 'password'
}

3 comments:

HectorinMiami said...

good call... sometimes you are working on someone else's project and you wonder where this error is coming from.

Lumbee said...

Damn it! Thats 2 hours I'll never get back. I made my action_mailer config changes in development.rb, but not production. Thanx...this saved me!!!

Uri Klar said...

I'm getting the same error but my app isn't even sending mails!