RSS feed

Nutsmuggling

Rails 2.3.3 + Ruby 1.8.7 + Gmail SMTP settings

It’s not rocket science, but since I took a while to figure this out I thought I’d share:

ActionMailer::Base.smtp_settings = {
  :enable_starttls_auto => true,
  :address => "smtp.gmail.com",
  :port => 587,
  :domain => "your-google-apps-domain",
  :authentication => :plain,
  :user_name => "username",
  :password => "password"
}

The most important line is enable_starttls_auto => true.

Unlike pre 2.2 Rails, no plugin is required. Not sure this setup works with Rails 2.2 though, never tried it.

Via this forum discussion.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Google
  • Technorati
  • StumbleUpon
  • Furl
  • Reddit

7 responses to “Rails 2.3.3 + Ruby 1.8.7 + Gmail SMTP settings”

  1. http://davidebenini.it/2009/06/25/rails-… « bst On Web Dev says:

    [...] 7:38 pm on November 15, 2009 Reply Tags: email (2), howtos, rails (85) http://davidebenini.it/2009/06/25/rails-233-ruby-187-gmail-smtp-settings/ – Rails 2.3.3 + Ruby 1.8.7 + Gmail SMTP settings [...]

  2. conspirisi says:

    where did you put that code?

  3. Ivan says:

    Yep, definitely useful.

  4. RubyPanther says:

    conspirisi: you put it in an initializer, like config/initializers/application.rb

  5. Jakub says:

    Many thanks ! I needed that :enablestarttlsauto wisdom :)

  6. trademark opposition says:

    I am really thankful to the author of this post for making this lovely and informative article live here for us. We really appreciate ur effort. Keep up the good work. . . .

  7. Gmail Password Hack says:

    I would have to agree with 99% of this.

Leave a Reply