问题描述:

I am using resque_mailer and mandrill_api to send mails for my rails application. Mails are getting delivered in development mode but on production mode, I am getting Net::OpenTimeout error. The complete error log is:

/usr/lib/ruby/2.1.0/net/smtp.rb:541:in `initialize'

/usr/lib/ruby/2.1.0/net/smtp.rb:541:in `open'

/usr/lib/ruby/2.1.0/net/smtp.rb:541:in `tcp_socket'

/usr/lib/ruby/2.1.0/net/smtp.rb:551:in `block in do_start'

/usr/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout'

/usr/lib/ruby/2.1.0/timeout.rb:101:in `call'

/usr/lib/ruby/2.1.0/timeout.rb:101:in `timeout'

/usr/lib/ruby/2.1.0/net/smtp.rb:550:in `do_start'

/usr/lib/ruby/2.1.0/net/smtp.rb:520:in `start'

/opt/gem/ruby/2.1.0/gems/mail-2.6.4/lib/mail/network/delivery_methods/smtp.rb:113:in `deliver!'

/opt/gem/ruby/2.1.0/gems/mail-2.6.4/lib/mail/message.rb:2149:in `do_delivery'

/opt/gem/ruby/2.1.0/gems/mail-2.6.4/lib/mail/message.rb:237:in `block in deliver'

/opt/gem/ruby/2.1.0/gems/actionmailer-4.1.14/lib/action_mailer/base.rb:527:in `block in deliver_mail'

/opt/gem/ruby/2.1.0/gems/activesupport-4.1.14/lib/active_support/notifications.rb:159:in `block in instrument'

/opt/gem/ruby/2.1.0/gems/activesupport-4.1.14/lib/active_support/notifications/instrumenter.rb:20:in `instrument'

/opt/gem/ruby/2.1.0/gems/activesupport-4.1.14/lib/active_support/notifications.rb:159:in `instrument'

/opt/gem/ruby/2.1.0/gems/actionmailer-4.1.14/lib/action_mailer/base.rb:525:in `deliver_mail'

/opt/gem/ruby/2.1.0/gems/mail-2.6.4/lib/mail/message.rb:237:in `deliver'

/opt/gem/ruby/2.1.0/gems/resque_mailer-2.2.7/lib/resque_mailer.rb:49:in `perform'

My smtp settings in production.rb is

config.action_mailer.delivery_method = :smtp

config.action_mailer.perform_deliveries = true

config.action_mailer.raise_delivery_errors = true

config.action_mailer.default_url_options = { host: "localhost:3000" }

config.action_mailer.smtp_settings = {

:address => "smtp.mandrillapp.com",

:port => 2525,

:domain => ENV['domain'],

:user_name => ENV['username'],

:password => ENV['password'],

:authentication => "plain",

:enable_starttls_auto => true

}

What am i doing wrong? Thanks in advance.

相关阅读:
Top