0

I have a Rails 4 app that I'm trying to deploy to production on heroku. I'm using ActionMailer :sendmail to send emails from the app. :sendmail works fine in development but the app does not seem to send out emails in production. The configuration for config/environments/development.rb is

Controlsafe::Application.configure do
  ........ 
  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.default_options = {from: '[email protected]'}
  config.action_mailer.delivery_method = :sendmail
  .......
end

And for config/environments/production.rb is

Controlsafe::Application.configure do
  ........ 
  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.default_url_options = {host: 'controlsafe.com'}
  config.action_mailer.default_options = {from: '[email protected]'}
  config.action_mailer.delivery_method = :sendmail
  .......
end

I'm not sure why the app is not sending out emails when it does fine in production. Does :sendmail even work in production? Or do I have to go with SMTP?

It would be awesome if anyone can provide some insight!

Thank you!

1 Answer 1

0

According to Heroku you need to use an external SMTP service

https://devcenter.heroku.com/articles/smtp

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.