✓ I'm available for hire! Check out my open source work on Github or drop me an email

Douglas F Shearer

Posts Tagged with gmail

There are 2 matching posts.

GMail SMTP with Ruby on Rails and ActionMailer

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 git://github.com/collectiveidea/action_mailer_optional_tls.git

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.

 
 

November 18th 2007

Add your comment

My Gmail Doesn't Support IMAP Yet

IMAP still not supported on your GMail account?

To get it you must set your language to English US in GMAIL settings. The POP tab will change to include IMAP when you save and go back to settings.

Gleaned from the Gmail supports IMAP announce post comments.

Enjoy!