title: wp_mail vs php mail()
body: <p>I'm trying to solve a problem with email being sent from a WordPress site, hosted on GoDaddy with its MX record set to a Dreamhost.com mail server.</p>
  
  <p>Email addressed to the site's domain <code>(me@mysitesdomain.com)</code> will not go through, yet email to any <code>@gmail.com</code> address will go through. I'm testing this with the following script ...</p>
  
  <pre><code>&lt;?php
  $mailResult = false;
  $from = "info@mysitesdomain.com";
  $to = "me@mysitesdomain.com";
  $subject = "PHP Mail Test script";
  $message = "This is a test to check the wp_mail functionality.";
  $headers = "From:" . $from;
  $mailResult = wp_mail( $to, $subject, $message, $headers );
  echo "mail result: ".$mailResult;
  ?&gt;
  </code></pre>
  
  <p>For both the <code>me@mysitesdomain.com</code> and the <code>me@gmail.com</code> address, the script's result is 1 (true).</p>
  
  <p>As a further test, I use a similar very simple script outside of Wordpress that uses PHP mail()...</p>
  
  <pre><code>&lt;?php 
  ini_set( 'display_errors', 1 );
  error_reporting( E_ALL );
  $from = "info@mysitesdomain.com";
  $to = "me@mysitesdomain.com";
  $subject = "PHP Mail Test script";
  $message = "This is a test to check the PHP Mail functionality.;
  $headers = "From:" . $from;
  mail($to,$subject,$message, $headers);
  echo "Test email sent";
  ?&gt;
  </code></pre>
  
  <p>That script successfully sends to both addresses. So, PHP <code>mail()</code> works but <code>wp_mail()</code> only works for <code>@gmail.com</code> addresses. What's going on within the wp_mail class that's different PHP php <code>mail()</code>?</p>