I have been trying to send emails to an account at Hotmail and for some reason the email wouldn't go through. I created a minimal script to make some tests, and I found that if the header of the email contains several lines mentioning MS Outlook information then everything is ok. Otherwise the mail does not go through!

This is my code:

<html>
<header><title>test mail</title></header>
<body>
<?php

$from = "user@adomain.com";

$to = "user@hotmail.com";

$extra = "From: <$from>"
."\r\nX-Priority: 3"
."\r\nX-MSMail-Priority: Normal"
."\r\nX-Mailer: Microsoft Outlook Express 6.00.2900.2180"
."\r\nX-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180";

mail($to, "test subject", "test mail", $extra);

?>
</body>
</html>

Just change the $from and $to variables.

If you try this code as it is, it works good. If you comment out the X-MSMail-Priority or the X-Mailer lines .. your email does not go through.

Now, can somebody tell me ... am I missing something or is MS so arrogant??

    Sounds like another monopoly lawsuit in the makings to me. A google search provides more wide spread problems than just yours with mail() and hotmail.

      the only header i add is

      X-MSMail-Priority: High

      and it seemingly always works for me.

      but yeah without that header emails dont get to the user.

        Should be a class action now that they are charging people for hotmail accounts. Are you sure about this?

          Originally posted by Roger Ramjet
          Should be a class action now that they are charging people for hotmail accounts. Are you sure about this?

          its been a few months since i last tried, but its been like that for a long time. fire off an email to a hotmail account and see if you get it.

            Well, we use outlook express here, so it's going to arrive anyway. No, my main worry is that my brother uses a paid for hotmail account as he spends half his life travelling for work. He will not realise that he's not getting some of his emails.

              what is your operating system ?

                EH!! If it's outlook express then, oh yes it must be winders. And it is not my emails I'm worried about.

                  Originally posted by rehfeld
                  the only header i add is

                  X-MSMail-Priority: High

                  and it seemingly always works for me.

                  but yeah without that header emails dont get to the user.

                  Yes this one alone seems to work fine.

                  Plus that if you fake the MS Outlook headers I wrote in the first post SpamAssassin adds about 1-3 points of spam score, because it can recognize that the header is fake.

                  But another strange thing is when I tried to send more than 1 emails to hotmail, with different subjects and slight differences in the headers. Only the first one went through. The next attempts, although in some of them I had the successful headers, where trashed by hotmail.

                    Just had a reply from my Bro, he's based in Hanoi at the moment. He recons it's Outlook Express that is giving him problems with Hotmail, that's what they use in his UK office. So it looks like MickeySoft have shot themselves in the foot again, or is it shot us in the foot.

                      A little bit of shooting for all of us is the answer.

                      If any MS emploee reads this ... tell them that all great empires of the history died because of their arrogance. This is how MS killed IBM, and this is how MS is going to die too.

                        But remember IBM is far from dead. There is still plenty of money in Big Iron, more than in the PC world. As Bill Gates is so fond of saying, MickeySoft is still only the 20th largest IT firm in the world.

                          a month later

                          Im just a begginner with PHP and was having trouble reaching my hotmail mailbox while testing PHP "mail()" All my other mailboxes were recieving including Yahoo. My emails were just disappearing, not into the junk folder and not bouncing back. After trying every code fix I could find in a google search, in the end the thing that worked for me was reformatting the actual text in the body of the email to make it look like a genuine email. Thats my 5 cents worth, hope it works for someone else.

                            Write a Reply...