title: AOL Rejecting email sent via PHP mail (error 5.2.1)
body: <p>Recently AOL has started rejecting emails sent from my production server.</p>
  
  <p>Customers make product enquiries through my site and can "cc" themselves if they wish.  I check for spam (e.g. don't send if request contains banned phrases, urls, etc). However, recently, if the enquirer is an AOL customer, the message bounces:</p>
  
  <pre><code>&lt;*removed!*@aol.com&gt;: host mailin-04.mx.aol.com[64.12.88.132] said: 521 5.2.1 :
      AOL will not accept delivery of this message. (in reply to end of DATA
      command)
  </code></pre>
  
  <p>Email protocol is <strong>not</strong> my area of expertise!  I just use the standard PHP mail() function and this has worked ok for years.  </p>
  
  <p>I have looked through the AOL Postmaster support pages and contacted AOL (which, obviously, was my first port of call - but they have yet to respond), plus I don't really understand the problem (which is 50% of finding the solution!).  </p>
  
  <p><a href="http://postmaster-blog.aol.com/2014/04/22/aol-mail-updates-dmarc-policy-to-reject/" rel="nofollow">http://postmaster-blog.aol.com/2014/04/22/aol-mail-updates-dmarc-policy-to-reject/</a></p>
  
  <p>...it seems as though AOL are saying "we don't like the way that you send emails, sorry to inconvenience you..."</p>
  
  <p>If anyone has any experience or specific insight into how to get AOL to accept emails then I would love to hear from you.  I'm guessing that it could be something to do with how my emails are formed: this hasn't changed in years and (previously) I've had no reason to look at the code:</p>
  
  <p>Here is an edited version of how I send emails...</p>
  
  <pre><code>$recipient = "\"$supplier[supplierName]\" &lt;$supplier[supplierEmail]&gt;";
  $subject = "$supplier[supplierName] enquiry";
  $headers = "MIME-Version: 1.0".PHP_EOL ;
  $headers .= "Content-type: text/html; charset=utf-8".PHP_EOL;
  $headers .= "Reply-To: \"$cleanArrayEmail[realname]\" &lt;$cleanArrayEmail[email]&gt;".PHP_EOL;
  $headers .= "From: \"Admin\" &lt;ADMIN_EMAIL&gt;".PHP_EOL;
  if ($_POST['cc']){$headers .= "cc: \"$cleanArrayEmail[realname]\" &lt;$cleanArrayEmail[email]&gt;".PHP_EOL;}
  
  mail ($recipient, $subject, $msg, $headers, '-f'. ADMIN_EMAIL );
  </code></pre>
  
  <p>Many thanks
  Steve</p>