class ActionMailer::Base
def headers(args = nil)
+nil+ in order to reset the value otherwise another field will be added
If you want to replace any header which already exists, first set it to
X-Anything can appear multiple times.
Fields can only appear once in email headers while other fields such as
* +references+
* +message-id+
* +orig-date+
* +reply-to+
* +bcc+
* +cc+
* +to+
* +from+
* +sender+
* +subject+
Note about replacing already defined headers:
X-Special-Domain-Specific-Header: SecretValue
The resulting +Mail::Message+ will have the following in its header:
'In-Reply-To' => incoming.message_id
headers 'X-Special-Domain-Specific-Header' => "SecretValue",
which will then be set on the +Mail::Message+ object:
You can also pass a hash into headers of header field names and values,
headers['X-Special-Domain-Specific-Header'] = "SecretValue"
object which will add them to itself.
Allows you to pass random and unusual headers to the new +Mail::Message+
def headers(args = nil) if args @_message.headers(args) else @_message end end