path = File.join(Rails.root, 'config', 'action_mailer.yml') options = YAML.load_file(path)[Rails.env] ActionMailer::Base.delivery_method = Rails.env.test? ? :test : :smtp ActionMailer::Base.smtp_settings = { :host => options['host'], :address => options['address'], :port => options['port'], :domain => options['domain'], :user_name => options['user_name'], :password => options['password'], :authentication => options['authentication'] }