views:

376

answers:

0

My application mailer works fine in development on my own machine but on the server it doesn't work the way I want.

I know the server is perfectly capable of relaying the emails requested because I can get it to work directly from the command line and if I put:

ActionMailer::Base.delivery_method = :sendmail

directly in my environment.rb file...

however I would like to move it to the production.rb file so I can use different setting between the dev and production servers. I'm using ssmtp to relay the mail.

In the production.rb file I tried:

#config.action_mailer.raise_delivery_errors = true
#config.action_mailer.perform_deliveries = true
#config.action_mailer.default_charset = 'utf-8'
config.action_mailer.delivery_method = :sendmail

and that gives me: Connection refused - connect(2)

any ideas? Thanks,

/usr/lib/ruby/1.8/net/smtp.rb:551:in `initialize'
/usr/lib/ruby/1.8/net/smtp.rb:551:in `open'
/usr/lib/ruby/1.8/net/smtp.rb:551:in `do_start'
/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/smtp.rb:551:in `do_start'
/usr/lib/ruby/1.8/net/smtp.rb:525:in `start'
/usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:681:in `perform_delivery_smtp'
/usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:523:in `__send__'
/usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:523:in `deliver!'
/usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.2/lib/action_mailer/base.rb:395:in `method_missing'
/var/rails/hostelapp/app/controllers/bookings_controller.rb:59:in `create'