Rails and SMTP on ubuntu 12.04 x64

  • Posted September 28, 2013

Running Rails 4 wih passenger, when attempt to send email it crashes with Completed 500 Internal Server Error (in the log). Do I need to set up Postfix in order to send emails from the app? My prduction SMTP settings

config.action_mailer.default_url_options = {:host =>'} config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => "localhost", :port => 25, :domain => '' }


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

quotes were missing (they were there before I tried mandrill though). <br> <br>I fixed quotes and added config.action_mailer.default_url_options host (domain name), restarted nginx - now looks like everything is working ok, email doesn’t go to spam. I’m using mandrill

<b>“I set up mandrill, sfp, DKIM and still emails go to spam…”</b> <br> <br>WTF!? The only thing I can think of is that your SPF record may need more time to propagate through the internet. <br> <br>RE: your SPF record <br> <br>Did you wrap it in quotes (if you’re using DigitalOcean’s DNS manager); and use <code>“… ~all”</code> at the end?

low end for sure, I send emails to register new users. I set up mandrill, sfp, DKIM and still emails go to spam (hotmail, gmail)… any idea what else can be done ?

How much mail do you anticipate sending? If it’s on the low end, perhaps a lightweight client like <a href=“”>exim4</a> would work?

I’ll try mandrill, after setting up postfix and SPF all emails go to spam… so it’s not very reliable. Thank you.

I recommend using a service such as Mandrill to send mail as it’s better than setting up your own mailserver. <br> <br>You can also install postfix and it should work fine.