Rails 2.0: Gmail SMTP With ActionMailer

Marc just checked in a nifty little Rails 2.0 plugin to the OpenRain public subversion repository which encapsulates the voodoo required to use a Gmail SMTP server with an otherwise ordinary ActionMailer configuration. Gmail requires TLS security, which is why this is useful. Grab the plugin for your Gmail-mooching Rails 2.0 site, here.

Note: I previously wrote about how to do this for Rails 1.2.x here.

Update (2008.06.25): Broken download link fixed!

 

  • Share/Bookmark
You can leave a response, or trackback from your own site.

No Responses to “Rails 2.0: Gmail SMTP With ActionMailer”

  1. pan says:

    Thanks I’ve been using that on my website.it’s quite convenient!

  2. John B says:

    I cannot follow your link to the download – does it still exist???

  3. Brent says:

    Hey Preston,
    I’m having a bit of a problem with the plugin. It works perfectly when I test it in my local dev environment, but in my production environment the emails never get sent and I see errors in the logs like this:

    -> “220 mx.google.com ESMTP f45sm9565579pyh.24\r\n”
    “250-mx.google.com at your service, [67.207.129.71]\r\n”
    -> “250-SIZE 28311552\r\n”
    -> “250-8BITMIME\r\n”
    -> “250-STARTTLS\r\n”
    -> “250 ENHANCEDSTATUSCODES\r\n”
    “220 2.0.0 Ready to start TLS\r\n”
    “250-mx.google.com at your service, [67.207.129.71]\r\n”
    -> “250-SIZE 28311552\r\n”
    -> “250-8BITMIME\r\n”
    -> “250-AUTH LOGIN PLAIN\r\n”
    -> “250 ENHANCEDSTATUSCODES\r\n”
    “535-5.7.1 Username and Password not accepted. Learn more at \r\n”
    -> “535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 f45sm9565579pyh.24\r\n”

    I’m 100% positive that the username and password are correct as the mailer.yml file is exactly the same in production and development. In fact, here’s my mailer.yml (with user/pass removed of course):


    :address: smtp.gmail.com
    :port: 587
    :user_name: blah@blah.com
    :password: blah
    :authentication: :plain

    Any ideas?

    Thanks in advance…

  4. preston.lee says:

    @John B

    Sorry about the broken link… We recently moved our public svn repository. Link has been updated. http://code.openrain.com/rails/action_mailer_tls/

  5. preston.lee says:

    @Brent

    Hmm… sorry, haven’t seen that before. You might want to ask Marc Chung though. (Email address in the README.) He’s the official maintainer of the plugin.

  6. Taurus says:

    Brent,

    Did you ever resolve your issue? I’m having the exact same problem. If so, please post the fix – many thanks in advance.

    Thanks,

    - Taurus

  7. preston.lee says:

    @Taurus, @Brent

    Please check with Marc :)

Leave a Reply