When using any of the built-in Mail delivery methods, this works as expected to send a custom header.
class FooMailer < ApplicationMailer
def foo_message
headers['X-CUSTOM'] = "I am some header"
mail(
:from => "example@example.com",
:to => "example@example.com",
:subject => "My Test message"
) do |format|
format.text { "I am a message. Wheeeeeee" }
end
end
end
This also works.
class FooMailer < ApplicationMailer
def foo_message
mail(
:from => "example@example.com",
:to => "example@example.com",
:subject => "My Test message",
"X-CUSTOM" => "I am some header"
) do |format|
format.text { "I am a message. Wheeeeeee" }
end
end
end
This gem is instead requiring this:
class FooMailer < ApplicationMailer
def foo_message
mail(
:from => "example@example.com",
:to => "example@example.com",
:subject => "My Test message",
:headers => {
"X-CUSTOM" => "I am some header"
}
) do |format|
format.text { "I am a message. Wheeeeeee" }
end
end
end
When using any of the built-in Mail delivery methods, this works as expected to send a custom header.
This also works.
This gem is instead requiring this: