VVulf
VVulf

Reputation: 59

Email doesn't send from Rails app using Mandrill

In production, my Rails app doesn't send emails. I'm using Heroku.

I've viewed a similar post, but the answer didn't help me.

It works for Gmail, but doesn't for Mandrill.

Gmail:

config.action_mailer.default_url_options = { host: 'app.herokuapp.com', :protocol => 'http' }
config.action_mailer.smtp_settings = {
  address: "smtp.gmail.com",
  port: 587,
  user_name: ENV['USERNAME'],
  password: ENV['PASSWORD']
}

Mandrill:

config.action_mailer.default_url_options = { host: 'app.herokuapp.com', :protocol => 'http' }
config.action_mailer.smtp_settings = {
  address: "smtp.mandrillapp.com",
  port: 25,
  user_name: ENV['USERNAME'],
  password: ENV['API_KEY']
}

Also note that I've tried switching the port numbers!

Upvotes: 0

Views: 403

Answers (1)

Manoj Monga
Manoj Monga

Reputation: 3083

I had used mandrill with one of my application and didn't get any complication. Please try to use these set of configuration and let me know if they doesn't work for you

config.action_mailer.default_url_options = { host: 'app.herokuapp.com' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
  :address => "smtp.mandrillapp.com",
  :port => 587,
  :user_name => ENV['USERNAME'],
  :password => ENV['API_KEY'],
  :authentication => 'login',
  :enable_starttls_auto => true,
  :openssl_verify_mode  => 'none'
}

Upvotes: 1

Related Questions