Skip to content

Instantly share code, notes, and snippets.

@caherrerapa
Created December 5, 2012 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caherrerapa/4218002 to your computer and use it in GitHub Desktop.
Save caherrerapa/4218002 to your computer and use it in GitHub Desktop.
mailer_rails
SampleApp::Application.configure do
...
require 'tlsmail'
Net::SMTP.enable_tls(OpenSSL::SSL::VERIFY_NONE)
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => 'smtp.gmail.com',
:port => 587,
:tls => true,
:domain => 'YOUR_DOMAIN_NAME.com',
:authentication => :plain,
:user_name => 'YOUR_USERNAME@YOUR_DOMAIN.com',
:password => 'YOUR_PASSWORD' # for security reasons you can use a environment variable too. (ENV['INFO_MAIL_PASS'])
}
...
config.action_mailer.default_url_options = { :host => 'YOUR_DOMAIN_NAME.com' }
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment