I know. I sound like a spammer, but these emails are completely legal email confirmations for people who have signed up for an account on this website that we developed. These emails are distributed to different mail providers (gmail, yahoo, aol, hotmail / live), but they always end up in the Outlook Junk Email folder. I tried using Zend Framework mail, PEAR Mail and phpMailer. All of these methods result in the same thing happening.
It seemed to start after Microsoft released an update for the Outlook spam filter in January of this year.
Below is the code:
include_once('Mail.php'); include_once('Mail/mime.php'); $hdrs = array( 'From' => "Membership < membership@example.com >", 'Subject' => 'Test Email', 'Reply-To'=> " membership@example.com ", 'Message-ID'=> "<" . str_pad(rand(0,12345678),8,'0',STR_PAD_LEFT) . "@mail.example.com>", 'Date'=> date("D, j MYH:i:s O",time()), 'To'=> ' test@example.com ' ); $params = array('host'=>'mail.example.com','auth'=>false,'localhost' => 'www.example.com','debug'=>false); $crlf = "\n"; $mime = new Mail_mime($crlf); $mime->setTXTBody("TEST"); $mime->setHTMLBody("<html>\n<body>\nTest\n</body>\n</html>"); $body = $mime->get(); $hdrs = $mime->headers($hdrs); $mail =& Mail::factory('smtp',$params); $t=$mail->send(' test@example.com ', $hdrs, $body);
As you can see, we use PEAR Mail functionality in this test. This is the most basic test we could run, and the above email is dumped into the Outlook Junk Email folder. We have reverse DNS on the mail server, and it corresponds to the transition DNS, SPF and DKIM, and there is nothing "spam" with the above content. Can someone see something with the above code that might make Outlook mark it as unwanted? Thanks!
source share