Skip to content

Instantly share code, notes, and snippets.

@dakatsuka
Created April 3, 2011 11:49
Show Gist options
  • Save dakatsuka/900380 to your computer and use it in GitHub Desktop.
Save dakatsuka/900380 to your computer and use it in GitHub Desktop.
config/initializers/email.yml(Production環境時のSMTP設定)
if Rails.env == "production"
filename = File.join(File.dirname(__FILE__), '..', 'email.yml')
if File.file?(filename)
config = YAML::load_file(filename)
if config.is_a?(Hash) && config.has_key?(Rails.env)
config[Rails.env].each do |k, v|
v.symbolize_keys! if v.respond_to?(:symbolize_keys!)
ActionMailer::Base.send("#{k}=", v)
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment