Skip to content

Instantly share code, notes, and snippets.

@bmc
Created February 14, 2011 18:39
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 bmc/826322 to your computer and use it in GitHub Desktop.
Save bmc/826322 to your computer and use it in GitHub Desktop.
ActionMailer: environment.rb
Rails::Initializer.run do |config|
# The following globals define the default SMTP configuration. To
# change the configuration in your environment, simply set these globals
# in your environment configuration (config/*.rb) file.
$smtp_address = 'smtpserver.example.com'
$smtp_domain = 'example.com'
$smtp_auth_type = :plain
$smtp_user = 'foobar@example.com'
$smtp_password = 'secret'
$smtp_port = 25
# Initialize ActiveMailer
config.after_initialize do
puts("SMTP configuration:")
puts(" SMTP server: #{$smtp_address}")
puts(" SMTP port: #{$smtp_port}")
puts(" SMTP domain: #{$smtp_domain}")
puts(" SMTP auth: #{$smtp_auth_type}")
puts(" SMTP user: #{$smtp_user}")
ActionMailer::Base.smtp_settings = {
:address => $smtp_address,
:domain => $smtp_domain,
:user_name => $smtp_user,
:password => $smtp_password,
:port => $smtp_port,
:authentication => $smtp_auth_type,
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment