Forum: Ruby on Rails Errno::ECONNREFUSED (Connection refused - connect(2)) Act

C42c706fab23da0b6d3cd2cfbb8db27d?d=identicon&s=25 Salil Gaikwad (salil)
on 2009-04-29 15:11
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:in `new'
    /usr/lib/ruby/1.8/net/protocol.rb:206:in `old_open'
    /usr/lib/ruby/1.8/timeout.rb:62:in `timeout'
    /usr/lib/ruby/1.8/timeout.rb:93:in `timeout'
    /usr/lib/ruby/1.8/net/protocol.rb:206:in `old_open'
    /usr/lib/ruby/1.8/net/smtp.rb:392:in `do_start'
    /usr/lib/ruby/1.8/net/smtp.rb:377:in `start'
    /usr/lib/ruby/1.8/net/smtp.rb:315:in `start'
    /vendor/rails/actionmailer/lib/action_mailer/base.rb:586:in
`perform_delivery_smtp'
    /vendor/rails/actionmailer/lib/action_mailer/base.rb:469:in
`__send__'
    /vendor/rails/actionmailer/lib/action_mailer/base.rb:469:in
`deliver!'
    /vendor/rails/actionmailer/lib/action_mailer/base.rb:383:in
`deliver'
    /app/controllers/login_controller.rb:88:in `create'
    /vendor/rails/actionpack/lib/action_controller/base.rb:1158:in
`send'
    /vendor/rails/actionpack/lib/action_controller/base.rb:1158:in
`perform_action_without_filters'
    /vendor/rails/actionpack/lib/action_controller/filters.rb:697:in
`call_filters'
    /vendor/rails/actionpack/lib/action_controller/filters.rb:689:in
`perform_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:in `measure'
    /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      => "abc@xyz.com",
    :password       => password here
  }
C42c706fab23da0b6d3cd2cfbb8db27d?d=identicon&s=25 Salil Gaikwad (salil)
on 2009-04-30 07:20
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
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.