Trying to use GMail SMTP (or some other SMTP authenticated with TLS) with ActiveRecord to send email in Ruby on Rails? Up till now this involved requiring smtp_tls.rb in your environment.
Thankfully, Kyle Maxwell has come up with a neater solution.
Install
It’s a plugin, which you can get with this command in your Rails root…
./script/plugin install http://svn.kylemaxwell.com/rails_plugins/action_mailer_optional_tls/trunk/
Due to continued downtime of Kyle’s site please use the following URl:
./script/plugin install http://svn.douglasfshearer.com/rails/plugins/action_mailer_optional_tls
Setup
You can turn TLS authentication on and off as you need in your environment with a new key that is added to the smtp config, tls. To use with gmail, the following should be in your environment.rb…
ActionMailer::Base.smtp_settings = {
:tls => true,
:address => "smtp.gmail.com",
:port => "587",
:domain => "YOURDOMAIN",
:authentication => :plain,
:user_name => "GOOGLEUSERNAME",
:password => "GOOGLEPASSWORD"
}
And that’s it. Enjoy.






Hugo
January 29 2008 20:52Hi,
I couldnt access the plugin URL.
Can you send it to me?
Is it the same plugin as this:
http://www.stephe...
Tks