Tuesday, July 22, 2008

ActionGmailer

Fast and easy if you know how to do it, a gigantic PITA if you don't. Here's how I did it with rails 2.0.2

install the tlsmail gem.

in environment.rb:

require 'rubygems'
require 'tlsmail'

Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)

config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "smtp.googlemail.com" ,
:port => 587,
:domain => "imap.googlemail.com" ,
:authentication => :plain,
:user_name => "you@gmail.com" ,
:password => ""
}

No comments: