note 70749 deleted from function.mail by tularis
| From: | tularis@php.net | Date: | Sun, 11 Jan 2015 15:27:16 +0000 |
| Subject: | note 70749 deleted from function.mail by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-201406@lists.php.net to get a copy of this message | ||
Note Submitter: tdaniel at univ dot haifa dot ac dot il
----
I had trouble getting multiple emails sent for Outlook accounts (a single PHP page performed 2
mail() calls).
The PHP mail() function works correctly, but the same mails that were recieved on a private POP3
server were randomly missing by our intranet Outlook exchange server.
If you have the same problem, try to verify that the "Message-ID: " is unique at the
$headers string. i.e.
<?php
$headers = [...] .
"Message-ID: <". time() .rand(1,1000).
"@".$_SERVER['SERVER_NAME'].">". "\r\n" [...];
?>
(rand() is used only for demonstration purposes. a better way is to use an index variable that
increments (i++) after each mail)
I noticed that when multiple messeges were sent simultaneously, the message-id was the same
(probably there was no miliseconds differential). My guess is that Outlook is collating messages
with the same message-ID; a thing that causes only one email to pass to the Outlook inbox instead of
a few.