Updating Gmail SSL SMTP Support for Ruby 1.8.7
January 13th, 2009
In Adding Gmail SSL SMTP Support to Rails I described the use of a simple Rails plugin to provide SSL SMTP support. Today I upgraded to a new version of Mephisto and while testing it in production I discovered that I couldn't send emails. It turns out that it had nothing to do with the Mephisto upgrade; my DreamHost server had been updated to Ruby 1.8.7 and the action_mailer_tls plugin I was using wasn't compatible. Oh well, I guess I deserved that surprise for using shared hosting and adding a monkey patch plugin. This post describes a simple fix. Read the rest of this entry
Adding Gmail SSL SMTP Support to Rails
December 4th, 2008
Jan. 13, 2009 Update: If you're using Ruby 1.8.7 see Updating Gmail SSL SMTP Support for Ruby 1.8.7 for a compatibility fix to the plugin used in this post.
DreamHost provides it's own SMTP support but their default set-up uses Gmail, which only supports SSL based SMTP connections. Rails 2.2 with Ruby 1.9 provides SSL support in ActionMailer via Ruby's 1.9 Net::SMTP class. That's great but it's still a very new combination and I wanted support for DreamHost's Ruby 1.8.5 and Mephisto using Rails 2.0.2. Fortunately it's simple to get SSL (a.k.a. TLS) based SMTP connections to work. Within a few minutes of hitting the browser search button I saw three options: lift 1.9 Net::SMTP code, use msmtp, and, the method I chose, a small plugin that patches Net::SMTP. No, I didn't look into the merits of each solution and I didn't do any type of exhaustive search to see what else might be available, I just picked what looked like an easy way to get the job done. This post documents where to find the plugin and how to use it. Read the rest of this entry