Skip to content

Instantly share code, notes, and snippets.

@intinig
Created February 10, 2015 13:17
Show Gist options
  • Save intinig/2073bce3ddd6b455a354 to your computer and use it in GitHub Desktop.
Save intinig/2073bce3ddd6b455a354 to your computer and use it in GitHub Desktop.
if ENV['SMTP_HOST'].present?
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => ENV['SMTP_HOST'],
:port => ENV['SMTP_PORT'],
:authentication => ENV['SMTP_AUTH'].to_sym,
:user_name => ENV['SMTP_USERNAME'],
:password => ENV['SMTP_PASSWORD'],
:domain => ENV['SMTP_DOMAIN'],
:enable_starttls_auto => (ENV['SMTP_TLS'] == 'true')
}
elsif !Rails.env.development?
config.action_mailer.delivery_method = :sendmail
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment