As you may know, the Ruby 1.8.* Net::SMTP library does not allow for TLS (SSL) connections. This prevents you from connecting to Gmail, or other mail servers that require a secure connection. Fortunatly, there is a pretty tight bit of code to fix this problem. As far as I can tell, this code originated at a japanese site. This code is all over, if you search for 'SMTP_TLS ruby.'
Great! We have the code! This is actually one of my favorite examples of the open source community. I originally got this code from a guy in Russia, who translated the Japanese page above. Pretty cool. Anyway, I don't really want to paste this code above every script I write that sends out an email. What about a gem!
I added the line in production.rb and together with the configurations that I already had it worked! :)UPDATE (12/18/07): Well it turns out there already is a gem for this. TLS Mail is not exactly the same as above, but it does the trick. The code in this gem is the code in the Ruby 1.9 source. The only catch is that you have to enable the TLS protocol before you send the mail:
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)Grab the code with "sudo gem install tlsmail"