Created
February 14, 2011 18:39
-
-
Save bmc/826322 to your computer and use it in GitHub Desktop.
ActionMailer: environment.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = '[email protected]' | |
$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