Skip to content

How to configure email notifications

raquelgb edited this page Jan 4, 2012 · 1 revision

Rails' ActionMailer can be configured to send e-mail notifications through any available SMTP server. Unfortunately most development environments do not offer a proper SMTP server, but most free email account providers (e.g. GMail) offer one.

Place the following lines at yourApp/config/initializers/mail_conf.rb. Keep in mind that this file should not be shared (i.e. add to your .gitignore if you plan to share your app) as it may contain your account password.

    ActionMailer::Base.delivery_method = :smtp
    ActionMailer::Base.smtp_settings = {
                :address              => "smtp.gmail.com",
                :port                 => 587,
                :domain               => 'gmail.com', # Domain for HELO.
                :user_name            => '<USERNAME>',
                :password             => '<PASSWORD>',
                :authentication       => 'plain',
                :enable_starttls_auto => true
        }
Clone this wiki locally