开发者

Microsoft outlook and PHP email fail to be a valid email it goes straight to the junk box if i change email contents to hello world works. rubish err

开发者 https://www.devze.com 2023-01-30 03:34 出处:网络
Nightmare Episode 1 I put 21 hours today to solve this. But i failed, asking experts to have a look, checked almost PEAR all possibilities but this Microsoft Outlook never gives up. What is this secr

Nightmare Episode 1

I put 21 hours today to solve this. But i failed, asking experts to have a look, checked almost PEAR all possibilities but this Microsoft Outlook never gives up. What is this secret ?

Microsoft Outlook 2010 as receives as junk 开发者_开发问答email when i put junk filter to "High". If i send another email with my same account from Google it goes to Inbox. What is the problem with this Outlook ? I tried to follow multipart/alternative or multipart/mixed or multipart/relative but all Same.

My server log shows: 100% ok no spam not blacklist, all clear Dec 8 15:42:30 www postfix/smtp[15250]: C99908162: to=, relay=mail.andmylab.com[01.01.01.01]:25, delay=0.25, delays=0.07/0.01/0.08/0.09, dsn=2.0.0, status=sent (250 OK id=1PQQqL-0001b6-TA)

My blacklist: www.whatismyipaddress.com shows no black list all green - I can send to Google or to my own domain and other domain without any problems.

My code: its generating exactly multipart/alternative where i am following RFC standards

  /* DB details */
  $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/cloude.ini', 'production');
  define("DBHOST",     $config->resources->db->params->host);
  define("DBUSER",     $config->resources->db->params->username);
  define("DBPASS",     $config->resources->db->params->password);
  define("DEFAULT_DB", $config->resources->db->params->dbname);
  define("MAILER_TABLE", "mail_queue");


  /* 1 --------------------- PEAR!! */
  require_once "Mail/Queue.php";
  require_once 'Mail/mime.php';
  require_once 'Mail/mimePart.php';

  /* 2 --------------------- DB */
  $db_options['type']       = 'db';
  $db_options['dsn']        = 'mysql://' . DBUSER . ":" . DBPASS . "@" . DBHOST . "/" . DEFAULT_DB;
  $db_options['mail_table'] = MAILER_TABLE;
  $mail_options['driver']   = 'mail';

  /* Step ------------------ 1 */
  $mail_queue =& new Mail_Queue($db_options, $mail_options);
  $from = "validguy@lul.be";

  /* Step ------------------ 2 */
  $mime =& new Mail_mime($crlf = "\n");
  $mail =& Mail::factory($mail_options['driver']); 

  /* Step ------------------ 3 Plain text and Html  */
  $data->mode = 'html';

  if ($data->mode=='html') 
  { 
      /* A <--------------- part */
      $params['content_type'] = 'multipart/alternative';
      $email = new Mail_mimePart('', $params);

      /* B <--------------- part */
      $email = $email->encode();
      $email['headers']['Mime-Version']   = '1.0';
      $email['headers']['Subject']        =  $fix;                
      $email['headers']['From']           =  $from; 

      //Zend_Debug::dump($email);
      // exit;

      /* C <--------------- part */
      $mime->setTXTBody('Test');
      $mime->setHTMLBody($txt2);

      /* D <--------------- part */
      $body = $mime->get();
      $hdrs = $mime->headers($email['headers']);                  


  } else if($data->mode=='both') {

    // later... for multipart/relative

  } else {

    // later... for inline    

  }

  /* Step 4 - done */
  $mailResult = $mail_queue->put($from, $row->email, $hdrs, $body, 0,true,$nres[0]['id']);
  //$mailResult = $mail_queue->put($from, $row->email, $email['headers'], $email['body'], 0,true,$nres[0]['id']);

  if(!PEAR::isError($mailResult)){ $m++; } else {   $n++; }

}

}

/* Relax........ */
echo "Records transfered: " . $m . "<br/>";
echo "Records failed to transfer: " . $n . "<br/>";

Nightmare Episode 1 (FOLLOW UP)

SPF fix (zone file setting, required) - Go to all SPF testing sites, and check what there wizard saying

Fix PTR (zone file setting, required)

Dkim proxy (zone file setting, required)

Prepare two version Plain text and Html

Check message headers from working emails that arrives without any problem to your inbox like (Google/Yahoo and others top companies), and compare that towards yours

Do not trust Microsoft Outlook 2010 or Old version, because in junk filter (high) its also written similar, it may not be a spam that must be a business issue, to make us stupid. And put us in nightmare to solve those issues.

  • If you don't agree in those TOP reasons, please advise and bit it, this is what i learned and trying to share, because its very annoying as a developer, if you don't have any answer for this RUBISH EROR, caused by Microsoft Outlook 2010.


First of all its Microsoft itself. To really overcome with this issue you can take action such as:

  1. MailChimp: very nice, after pulling all my hair out why it does not work, i found that they got some nice templates with special secret inside, but any way, i just customized it, and it works, i can hit straight crap Outlook express "Inbox" even its high spam filtered.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号