[Ruby on Rails] Email Sending Process with Action Mailer

Tadashi Shigeoka ·  Thu, February 28, 2013

A memo on how to handle email sending processes with Action Mailer in Ruby on Rails.

Mainly read these resources:

Action Mailer Basics — Ruby on Rails Guides

Rails 3 Action Mailer Summary - Interesting Web Service Development Diary

ActionMailer Sending Email from Rails Apps - Sake, Tears, Ruby and Rails

Action Mailer

How to Configure for Sending via Gmail

Configure in config/environments/production.rb like the following:

MyApp::Application.configure do
  # Mailer
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.delivery_method = :smtp

  config.action_mailer.smtp_settings = {
    address: "smtp.gmail.com",
    port: 587,
    domain: 'example.com',
    user_name: "gmail_user",
    password: "gmail_pass",
    authentication: 'plain',
    enable_starttls_auto: true,
  }
end

[Reference]

Using Gmail for Email Sending in Rails 3.0 - LazyLoadLife

Setting up Gmail as Email Client in Rails | simpleplay’s Log

That’s all from the Gemba.