title: PHP Sending Mail with Headers to Gmail
body: <p>The <code>mail()</code> function in PHP works fine when sending to Gmail if I don't specify any headers.  However, as soon as I try to add in headers, the function still returns <code>true</code> but I never get the email.  The Gmail server seems to reject the delivery.</p>
  
  <p>These are the headers I'm using:</p>
  
  <pre><code>$headers = 'MIME-Version: 1.0' . "\r\n";
  $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  $headers .= 'To: ' . $username . ' &lt;' . $email . '&gt;' . "\r\n";
  $headers .= 'From: Blahblah &lt;email@example.com&gt;' . "\r\n";
  mail($email, 'Subject', '&lt;html&gt;&lt;body&gt;Body of message&lt;/body&gt;&lt;/html&gt;', $headers);
  </code></pre>
  
  <p>I was hoping that someone could point out to me the flaw?  I grabbed most of this code straight from the PHP manual, so one could understand my confusion and frustration.  Thanks!</p>