Skip to content

Instantly share code, notes, and snippets.

@marcelonmoraes
Created September 9, 2011 18:43
Show Gist options
  • Select an option

  • Save marcelonmoraes/1206995 to your computer and use it in GitHub Desktop.

Select an option

Save marcelonmoraes/1206995 to your computer and use it in GitHub Desktop.
ActionMailer + Gmail
require 'action_mailer'
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.smtp_settings = {
:address => 'smtp.gmail.com',
:port => 587,
:domain => 'email.com',
:user_name => 'username',
:password => 'password',
:authentication => :plain,
:enable_starttls_auto => true
}
mail = Mail.new do
from 'from@email.com'
to 'to@email.com'
subject 'email subject'
body 'body content'
end
mail.deliver
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment