Redmine/Rails email through Gmail SMTP

Here is a bit of help getting [Redmine](, or any Rails app, to send email over SMTP through an existing [Gmail]( account.
It’s quite easy to set up and you gain the usual perks of having everything centralized in a Gmail account. Note: this works with [Google Apps for your domain](, too.

First you’ll need to install the smtp_tls plugin into your application’s lib directory so you can correctly authenticate. For posterity, I’ve uploaded a copy [smtp_tls.rb]( along with this post.

www@host:~/redmine$ cd lib
www@host:~/redmine/lib$ curl -O

Redmine utilizes email.yml to configure [ActionMailer]( Here’s what ours looks like:

    delivery_method: :smtp
      port: 587
      authentication: :login
      password: password

Next, in production.rb makre sure to

require 'smtp_tls'

That’s it, you’re good to go.

If you want to set up any old Rails app [using Action Mailer] to send mail via Gmail, add this to production.rb

require 'smtp_tls' 

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.default_charset = "utf-8"

ActionMailer::Base.smtp_settings = {
:address => "",
:port => 587,
:domain => "",
:authentication => :login,
:user_name => "",
:password => "password",
  • japan shah


    revert your redmine SVN

    it works !!

  • Huy Vu

    Thank you for your post. It’s work for me

  • Henrique Mattos

    It’s not working for me. Can’t realize why.
    I’m having this return: “wrong number of arguments (3 for 2)” but can’t understand why and where it’s wrong.

  • koko jumbo

    i fight with that configuration for hours after i did all that this guys said, and finally i notice that this two files are not equal, so make sure that this two files are identical:

    • /vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb
    • /lib/smtp_tls.rb

    this fixed my problem. (thanks god..)

    koko jumbo.

  • atif

    Hi All,
    can anyone tell me how i can configure redmine 0.9.4 to recieve emils from POP3 or smtp

  • Anitha

    Thank you…

    After a number of searches for the smtp_tls.rb and everything else in the world… finally your post got me things rolling!!!

  • Malakias

    Awesome post and great comment about same files smtp_tls.rb!!!


  • zfilin

    Thank you for your script!
    Your method better than described here:
    Anyway your method works!

  • Harshit

    Works fantastic! Thanks

  • Humberto Borba

    I have a Ubuntu Server 10.10.
    I tried to setup my Redmine with Gmail SMTP.

    But I got this error:

    An error occurred while sending mail ({{value}})

    This error appear when I sent an email test on Redmine Adminitration.

    Any ideia?
    Thank you!