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;








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










share|improve this question
























  • 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

















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










share|improve this question
























  • 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













0












0








0


1






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










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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

















  • 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
















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












2 Answers
2






active

oldest

votes


















0














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






share|improve this answer






























    0














    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);





    share|improve this answer



























      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
      );



      );













      draft saved

      draft discarded


















      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









      0














      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






      share|improve this answer



























        0














        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






        share|improve this answer

























          0












          0








          0







          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






          share|improve this answer













          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







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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























              0














              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);





              share|improve this answer





























                0














                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);





                share|improve this answer



























                  0












                  0








                  0







                  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);





                  share|improve this answer















                  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);






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Apr 4 at 7:39

























                  answered Apr 4 at 7:32









                  YogeshYogesh

                  3442 silver badges11 bronze badges




                  3442 silver badges11 bronze badges



























                      draft saved

                      draft discarded
















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                      용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                      155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해