rails/rails — pull request #6747 by paneq (2012-06-15 17:40:57+00:00)
Title: Allow to easily set default :from option using railties in config/application.rb

This is currently not possible using `#default` method because

```ruby
config.action_mailer.default(from: "no-replay@example.org")
```

is interpreated as reader method and just returns nil. It does not call `ActionMailer::Base.default` method. The only way of calling `ActionMailer::Base` methods from `config/application.rb` is to use the direct syntax which is ugly in my opinion:

```ruby
config.assets.enabled = false
config.assets.version = '1.0'
config.encoding = "utf-8"
config.action_mailer.default_url_options={host:"example.org", protocol:"https" }
ActionMailer::Base.default(from: "no-replay@example.org")
```

Also the `:from` option is probably the same across multiple mailers. Other options like `:to, :subject, :cc, :bcc` etc. differ between mailing templates but `:from` is usually constant. So i think it deserves a simple way for setting it.