<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
Hi Adam,<br>
<br>
That sounds a great idea. Didn't know you could make O365 do that.<br>
<br>
I've added it as a new setting at the bottom of the SMTP* settings,
called "SMTPextraHeaders". It's just a simple array of strings as
you suggest.<br>
<br>
It will be in the next release (which I'm actually working on!!).<br>
<br>
Sorry this has taken so long, I haven't done any ZendTo maintenance
in far too long.<br>
<br>
Thanks!<br>
Jules.<br>
<br>
<div class="moz-cite-prefix">On 10/07/2023 3:54 pm, Adam Thorn via
ZendTo wrote:<br>
</div>
<blockquote type="cite"
cite="mid:WM!619d4d6378e33184e5b98f9b00cffda41611dcd6d1e573140e8512bd87e345e05b356cf281c98288b110310a5557ee85!@mx.jul.es">Would
it be possible to add support for specifying custom mail headers
to the mails sent by ZendTo? My specific use case is to be able to
specify a header specific to Exchange Online which controls the
sending of various out-of-office-type autoreplies..
<br>
<br>
<a class="moz-txt-link-freetext" href="https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcmail/ced68690-498a-4567-9d14-5c01f974d8b1">https://learn.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxcmail/ced68690-498a-4567-9d14-5c01f974d8b1</a>
<br>
<br>
..on the basis that I know that header is useful for many of my
recipients.
<br>
<br>
It looks like for PHPMailer one calls $mail->addCustomHeader()
:
<br>
<br>
<a class="moz-txt-link-freetext" href="https://phpmailer.github.io/PHPMailer/classes/PHPMailer-PHPMailer-PHPMailer.html#method_addCustomHeader">https://phpmailer.github.io/PHPMailer/classes/PHPMailer-PHPMailer-PHPMailer.html#method_addCustomHeader</a>
<br>
<br>
whereas for php's mail() one just appends to the $header string
that gets eventually passed to mail().
<br>
<br>
mail() expects a raw header line in the form 'Header-Name:
Header-Value', whereas PHPMailer supports being called either with
two arguments:
<br>
<br>
$mail->addCustomHeader('Header-Name', 'Header-Value');
<br>
<br>
or with just a single argument of the same form that could be
given directly to mail():
<br>
<br>
$mail->addCustomHeader('Header-Name: Header-Value');
<br>
<br>
Thus, it might be simpler to go for the second form and to have an
optional array one could specify in the preferences of the form..
<br>
<br>
$prefs = array(
<br>
...
<br>
'extraMailHeaders' => array(
<br>
'My-First-Header: Foo',
<br>
'My-Second-Header: Bar',
<br>
),
<br>
...
<br>
);
<br>
<br>
which can then either be immediately passed to addCustomHeader()
or imploded and added to $headers, as appropriate.
<br>
<br>
Regards,
<br>
<br>
Adam
<br>
<br>
_______________________________________________
<br>
ZendTo mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:ZendTo@zend.to">ZendTo@zend.to</a>
<br>
<a class="moz-txt-link-freetext" href="http://jul.es/mailman/listinfo/zendto">http://jul.es/mailman/listinfo/zendto</a>
<br>
</blockquote>
<br>
<pre class="moz-signature" cols="72">Jules
--
Julian Field MEng CEng CITP MBCS MIEEE MACM
'If I were a Brazilian without land or money or the means to feed
my children, I would be burning the rain forest too.' - Sting
<a class="moz-txt-link-abbreviated" href="http://www.Zend.To">www.Zend.To</a>
Twitter: @JulesFM
</pre>
</body>
</html>