Recently I needed to setup smtp server to send mail. nothing was new, I simply used rails ActionMailer as one should be. It should have been working, but wait; ohhhhhh snap, it was not!

It came out to be our very own google’s fault. Yes! as the email server was hosted on google app. And our google uses SSL SMTP or to be precise STARTTLS for routing emails. So here I am writing down step by step, what worked for me.

1.) Create #{RAILS_ROOT}/config/mailer_settings.yml with following code

Note: you can use enable_starttls_auto directly if your rails version > 2.2 and rubyversion is >=1.8.7, because built-in support for starttls. If not, then also you can use it; but you first need to install this gem.

2.) Load mail configuration settings, if not in test environment

Happy Boarding ;)

About The Author

I am Pankaj Baagwan, a System Design Architect. A Computer Scientist by heart, process enthusiast, and open source author/contributor/writer. Advocates Karma. Love working with cutting edge, fascinating, open source technologies.

  • To consult Pankaj Bagwan on System Design, Cyber Security and Application Development, SEO and SMO, please reach out at me[at]bagwanpankaj[dot]com

  • For promotion/advertisement of your services and products on this blog, please reach out at me[at]bagwanpankaj[dot]com

Stay tuned <3. Signing off for RAAM