How to add custom header to zend MailMessageProblem with Gmail messages missing headersZend Mail Exception - unroutable Address - why?zend framework 2 mail set default sendersending ical through zend_mailMultipart messages including multiple attachments (“attachment” and “inline”) with Zend Mail – RFC-compliant?Zend framework : Print message and then redirectsending email using zend/mailZend Framework - Send only 1 mailWhy was the mail sent but not received in zend framework?Setting up default transport method in Zend Framework 2.4 for ZendMailMessage
Why must API keys be kept private?
From the start of the game what is the longest possible series of consecutive white moves where white can do those moves no matter what black does?
What is a "staved" town, like in "Staverton"?
How to ask my manager for a part-time?
The seven story archetypes. Are they truly all of them?
Are symplectomorphisms of Weil–Petersson symplectic form induced from surface diffeomorphisms?
How can I deal with someone that wants to kill something that isn't supposed to be killed?
Can't understand how static works exactly
What is an Eternal Word™?
Download file from URL to Safehouse
Travelling from Venice to Budapest, making a stop in Croatia
Company requiring me to let them review research from before I was hired
I have a domain, static IP address and many devices I'd like to access outside my house. How do I route them?
"It is what it is" in French
Where is this photo of a group of hikers taken? Is it really in the Ural?
Is there a way to factor age into the mass-luminosity relationship for stars?
What's the explanation for this joke about a three-legged dog that walks into a bar?
Is there a way to shorten this while condition?
Why is chess failing to attract big name sponsors?
What happens when two cards both modify what I'm allowed to do?
Why did modems have speakers?
Are irregular workouts through the day effective?
Using paddles to support a bug net
Impact of throwing away fruit waste on a peak > 3200 m above a glacier
How to add custom header to zend MailMessage
Problem with Gmail messages missing headersZend Mail Exception - unroutable Address - why?zend framework 2 mail set default sendersending ical through zend_mailMultipart messages including multiple attachments (“attachment” and “inline”) with Zend Mail – RFC-compliant?Zend framework : Print message and then redirectsending email using zend/mailZend Framework - Send only 1 mailWhy was the mail sent but not received in zend framework?Setting up default transport method in Zend Framework 2.4 for ZendMailMessage
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am using ZendMailMessage to send an emails.Need to add some custom headers to mail but MailMessage don't have addHeader() function.I am using Zend Framework 2.Is there any other function which can be used to add custom headers to mails.I had referred link in documentation.But I can not find addHeader in MailMessage.
zend-mail version is 2.10.0
zend-framework zend-framework2 zend-mail
|
show 4 more comments
I am using ZendMailMessage to send an emails.Need to add some custom headers to mail but MailMessage don't have addHeader() function.I am using Zend Framework 2.Is there any other function which can be used to add custom headers to mails.I had referred link in documentation.But I can not find addHeader in MailMessage.
zend-mail version is 2.10.0
zend-framework zend-framework2 zend-mail
It's methodaddHeader()- not with underscore in name but rather camelCased.
– Tpojka
Mar 26 at 15:18
Sorry that was typo updated the question
– Yogesh
Mar 26 at 15:20
What is error/output when you useaddHeader('X-Key', 'value')?
– Tpojka
Mar 26 at 15:23
addHeader() method not found.I had checked with class also MailMessage it don't have this function
– Yogesh
Mar 26 at 15:28
Double check in composer file what version you are using there.
– Tpojka
Mar 26 at 15:35
|
show 4 more comments
I am using ZendMailMessage to send an emails.Need to add some custom headers to mail but MailMessage don't have addHeader() function.I am using Zend Framework 2.Is there any other function which can be used to add custom headers to mails.I had referred link in documentation.But I can not find addHeader in MailMessage.
zend-mail version is 2.10.0
zend-framework zend-framework2 zend-mail
I am using ZendMailMessage to send an emails.Need to add some custom headers to mail but MailMessage don't have addHeader() function.I am using Zend Framework 2.Is there any other function which can be used to add custom headers to mails.I had referred link in documentation.But I can not find addHeader in MailMessage.
zend-mail version is 2.10.0
zend-framework zend-framework2 zend-mail
zend-framework zend-framework2 zend-mail
edited Mar 26 at 15:32
Yogesh
asked Mar 26 at 14:58
YogeshYogesh
3442 silver badges11 bronze badges
3442 silver badges11 bronze badges
It's methodaddHeader()- not with underscore in name but rather camelCased.
– Tpojka
Mar 26 at 15:18
Sorry that was typo updated the question
– Yogesh
Mar 26 at 15:20
What is error/output when you useaddHeader('X-Key', 'value')?
– Tpojka
Mar 26 at 15:23
addHeader() method not found.I had checked with class also MailMessage it don't have this function
– Yogesh
Mar 26 at 15:28
Double check in composer file what version you are using there.
– Tpojka
Mar 26 at 15:35
|
show 4 more comments
It's methodaddHeader()- not with underscore in name but rather camelCased.
– Tpojka
Mar 26 at 15:18
Sorry that was typo updated the question
– Yogesh
Mar 26 at 15:20
What is error/output when you useaddHeader('X-Key', 'value')?
– Tpojka
Mar 26 at 15:23
addHeader() method not found.I had checked with class also MailMessage it don't have this function
– Yogesh
Mar 26 at 15:28
Double check in composer file what version you are using there.
– Tpojka
Mar 26 at 15:35
It's method
addHeader() - not with underscore in name but rather camelCased.– Tpojka
Mar 26 at 15:18
It's method
addHeader() - not with underscore in name but rather camelCased.– Tpojka
Mar 26 at 15:18
Sorry that was typo updated the question
– Yogesh
Mar 26 at 15:20
Sorry that was typo updated the question
– Yogesh
Mar 26 at 15:20
What is error/output when you use
addHeader('X-Key', 'value')?– Tpojka
Mar 26 at 15:23
What is error/output when you use
addHeader('X-Key', 'value')?– Tpojka
Mar 26 at 15:23
addHeader() method not found.I had checked with class also MailMessage it don't have this function
– Yogesh
Mar 26 at 15:28
addHeader() method not found.I had checked with class also MailMessage it don't have this function
– Yogesh
Mar 26 at 15:28
Double check in composer file what version you are using there.
– Tpojka
Mar 26 at 15:35
Double check in composer file what version you are using there.
– Tpojka
Mar 26 at 15:35
|
show 4 more comments
2 Answers
2
active
oldest
votes
According to the documentation you should consider to use the headers like this :
$message->getHeaders()->addHeaderLine('X-API-Key', 'FOO-BAR-BAZ-BAT');
Full documentation is found here
add a comment |
Issue with following is it append <=?UTF-8?Q?$header?=>: to value$this->getHeaders()->addHeader($header) but I was needing plain headers.
I had created Custom class which extends the ZendMailHeaderHeaderInterface
And overwrite public static function fromString function. Passed the header as follows
$customHeader = CustomHeaderClass::fromString($header);
$this->getHeaders()->addHeader($customHeader);
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55360232%2fhow-to-add-custom-header-to-zend-mail-message%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
According to the documentation you should consider to use the headers like this :
$message->getHeaders()->addHeaderLine('X-API-Key', 'FOO-BAR-BAZ-BAT');
Full documentation is found here
add a comment |
According to the documentation you should consider to use the headers like this :
$message->getHeaders()->addHeaderLine('X-API-Key', 'FOO-BAR-BAZ-BAT');
Full documentation is found here
add a comment |
According to the documentation you should consider to use the headers like this :
$message->getHeaders()->addHeaderLine('X-API-Key', 'FOO-BAR-BAZ-BAT');
Full documentation is found here
According to the documentation you should consider to use the headers like this :
$message->getHeaders()->addHeaderLine('X-API-Key', 'FOO-BAR-BAZ-BAT');
Full documentation is found here
answered Mar 29 at 9:45
Greco JonathanGreco Jonathan
1,7142 gold badges18 silver badges43 bronze badges
1,7142 gold badges18 silver badges43 bronze badges
add a comment |
add a comment |
Issue with following is it append <=?UTF-8?Q?$header?=>: to value$this->getHeaders()->addHeader($header) but I was needing plain headers.
I had created Custom class which extends the ZendMailHeaderHeaderInterface
And overwrite public static function fromString function. Passed the header as follows
$customHeader = CustomHeaderClass::fromString($header);
$this->getHeaders()->addHeader($customHeader);
add a comment |
Issue with following is it append <=?UTF-8?Q?$header?=>: to value$this->getHeaders()->addHeader($header) but I was needing plain headers.
I had created Custom class which extends the ZendMailHeaderHeaderInterface
And overwrite public static function fromString function. Passed the header as follows
$customHeader = CustomHeaderClass::fromString($header);
$this->getHeaders()->addHeader($customHeader);
add a comment |
Issue with following is it append <=?UTF-8?Q?$header?=>: to value$this->getHeaders()->addHeader($header) but I was needing plain headers.
I had created Custom class which extends the ZendMailHeaderHeaderInterface
And overwrite public static function fromString function. Passed the header as follows
$customHeader = CustomHeaderClass::fromString($header);
$this->getHeaders()->addHeader($customHeader);
Issue with following is it append <=?UTF-8?Q?$header?=>: to value$this->getHeaders()->addHeader($header) but I was needing plain headers.
I had created Custom class which extends the ZendMailHeaderHeaderInterface
And overwrite public static function fromString function. Passed the header as follows
$customHeader = CustomHeaderClass::fromString($header);
$this->getHeaders()->addHeader($customHeader);
edited Apr 4 at 7:39
answered Apr 4 at 7:32
YogeshYogesh
3442 silver badges11 bronze badges
3442 silver badges11 bronze badges
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55360232%2fhow-to-add-custom-header-to-zend-mail-message%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It's method
addHeader()- not with underscore in name but rather camelCased.– Tpojka
Mar 26 at 15:18
Sorry that was typo updated the question
– Yogesh
Mar 26 at 15:20
What is error/output when you use
addHeader('X-Key', 'value')?– Tpojka
Mar 26 at 15:23
addHeader() method not found.I had checked with class also MailMessage it don't have this function
– Yogesh
Mar 26 at 15:28
Double check in composer file what version you are using there.
– Tpojka
Mar 26 at 15:35