title: wp_mail (Wordpress mail function) not sending to gmail or live.co.uk accounts
body: <p>I have a website that allows visitors to contact me two ways - via a contact form on it's own page and via an 'ajax' small contact form in the sidebar.</p>
  
  <p>Both forms of contact send an email to my gmail account.</p>
  
  <p>The contact form on it's own page works fine but the ajax form doesn't send to gmail (nor does it send to email addresses ending in .live.co.uk)</p>
  
  <p>If I change the 'to' address on the ajax contact form to one of my other domains (i.e. a different email address) then it works fine.</p>
  
  <p>I've checked the headers of the emails that are sent and ended up installing a 'plugin' that alters the return-path in case Google (and live.co.uk) check this before accepting emails. This hasn't made any difference.</p>
  
  <p>There is a lot of chatter on these forums and others about wp_mail not sending to gmail but no actual solution.</p>
  
  <p>I've checked the gmail spam folders etc in case the emails went in there but they are not.</p>
  
  <p>I've also tried using just the 'mail()' function but to no avail.</p>
  
  <p>My code on the page that the ajax call goes to looks like this:</p>
  
  <pre><code>$headers  = 'From: myWebsite &lt;enquiries@mywebsite.co.uk&gt;' . "\r\n";
  $headers .= 'Reply-To: myWebsite &lt;enquiries@mywebsite.co.uk&gt;';
  $email_to = "myemailaddy@gmail.com";
  wp_mail( $email_to , sanitize_text_field( $subjectLine ), wp_strip_all_tags( $emailContent ), $headers );
  $email_to = "myemailaddy@anotherdomain.com";
  wp_mail( $email_to , sanitize_text_field( $subjectLine ), wp_strip_all_tags( $emailContent ), $headers );
  </code></pre>
  
  <p>Everytime the form is submitted I get the email to my 'anotherdomain.com' address but not to my gmail.com address.</p>
  
  <p>Any ideas?</p>