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


#1

Hi All,

I encountered with following error when i try to send e-mail in
production mode.

Errno::ECONNREFUSED (Connection refused - connect(2)):
/usr/lib/ruby/1.8/net/protocol.rb:206:in initialize' /usr/lib/ruby/1.8/net/protocol.rb:206:innew’
/usr/lib/ruby/1.8/net/protocol.rb:206:in old_open' /usr/lib/ruby/1.8/timeout.rb:62:intimeout’
/usr/lib/ruby/1.8/timeout.rb:93:in timeout' /usr/lib/ruby/1.8/net/protocol.rb:206:inold_open’
/usr/lib/ruby/1.8/net/smtp.rb:392:in do_start' /usr/lib/ruby/1.8/net/smtp.rb:377:instart’
/usr/lib/ruby/1.8/net/smtp.rb:315:in start' /vendor/rails/actionmailer/lib/action_mailer/base.rb:586:inperform_delivery_smtp’
/vendor/rails/actionmailer/lib/action_mailer/base.rb:469:in
__send__' /vendor/rails/actionmailer/lib/action_mailer/base.rb:469:indeliver!’
/vendor/rails/actionmailer/lib/action_mailer/base.rb:383:in
deliver' /app/controllers/login_controller.rb:88:increate’
/vendor/rails/actionpack/lib/action_controller/base.rb:1158:in
send' /vendor/rails/actionpack/lib/action_controller/base.rb:1158:inperform_action_without_filters’
/vendor/rails/actionpack/lib/action_controller/filters.rb:697:in
call_filters' /vendor/rails/actionpack/lib/action_controller/filters.rb:689:inperform_action_without_benchmark’
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
perform_action_without_rescue' /usr/lib/ruby/1.8/benchmark.rb:293:inmeasure’
/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
`perform_action_without_rescue’

i use following credentials in config/enviorment.rb

config.action_mailer.smtp_settings = {
:address => “smtpout.secureserver.net”,
:port => 25,
:domain => “xyz.com”,
:authentication => :login,
:user_name => “removed_email_address@domain.invalid”,
:password => password here
}


#2

It’s done.

i change two things

1] in enviorment.rb
ActionMailer::Base.delivery_method = :smtp

to

ActionMailer::Base.delivery_method = :sendmail

and

2] in config\environments\production.rb

uncomment following line

config.action_mailer.raise_delivery_errors = false