source: subversion/sites/rails_port/config/initializers/action_mailer.rb @ 15351

Last change on this file since 15351 was 15351, checked in by tomhughes, 10 years ago

Put ActionMailer? configuration in the right place.

File size: 555 bytes
Line 
1# Configure ActionMailer SMTP settings
2ActionMailer::Base.smtp_settings = {
3  :address => 'localhost',
4  :port => 25, 
5  :domain => 'localhost',
6}
7
8# This will let you more easily use helpers based on url_for in your mailers.
9ActionMailer::Base.default_url_options[:host] = APP_CONFIG['host']
10
11# Monkey patch to fix return-path bug in ActionMailer 2.2.2
12# Can be removed once we go to 2.3
13module Net
14  class SMTP
15    def sendmail(msgstr, from_addr, *to_addrs)
16      send_message(msgstr, from_addr.to_s.sub(/^<(.*)>$/, "\\1"), *to_addrs)
17    end
18  end
19end
Note: See TracBrowser for help on using the repository browser.