Skip to content

Instantly share code, notes, and snippets.

@almaron
Created November 12, 2012 16:35
Show Gist options
  • Select an option

  • Save almaron/4060362 to your computer and use it in GitHub Desktop.

Select an option

Save almaron/4060362 to your computer and use it in GitHub Desktop.
options = YAML.load_file("#{Rails.root}/config/mailer.yml")[Rails.env]
ActionMailer::Base.smtp_settings = options['smtp']
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.default_url_options[:host] = options['host']
ActionMailer::Base.raise_delivery_errors = true if Rails.env.development?
require 'development_mail_interceptor'
Mail.register_interceptor(DevelopmentMailInterceptor) if Rails.env.development?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment