title: PHP mail goes in spam and inbox
body: <p>I am using simple PHP mail function to send mail. Here is my code:</p>
  
  <pre><code>sendEmail('xyz@gmail.com', 'test subject', 'test body', 'xyz name', 'abc@gmail.com', 'HTML');
  
  function sendEmail($to, $subject, $body, $fromName, $from, $format = '')
  {
      $headers = '';
  
      if($format=='HTML')
      {
          $headers .= "Content-type: text/html; charset=iso-8859-1\n";
      }
  
      $headers .= "From: $fromName &lt;$from&gt;" . "\n";
  
      $success = mail($to, $subject, $body, $headers, '-f no-reply@xyz.com');
      return $success;
  
  }
  </code></pre>
  
  <p>My problem is this when i send more than one (like 10) mail then some mail goes into spam and some in inbox. If script is wrong then all mail should go into spam or if right then all mail into inbox.</p>
  
  <p>Why some mail goes into spam and some in inbox?</p>
  
  <p>while subject, body, message and email(to) is same.</p>