title: Why wp_mail() function isn't sending any emails and displaying '0' in Chrome 'Network' response
body: <p>I'm trying to send emails through wordpress using wp_mail() function and it doesn't seem to work. </p>
  
  <p>It's displaying <code>0</code> in Chrome 'Network' response
  with </p>
  
  <pre><code>Status Code:200 OK
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/sXLNG.png" alt="enter image description here"></p>
  
  <p>this my code part: </p>
  
  <pre><code>// Contact form  Ajax 
  
  add_action('wp_ajax_nopriv_submit_contact_form', 'submit_contact_form'); 
  
  function submit_contact_form(){
  
      if(isset($_POST['email'])) {
  
          $email = $_POST['email'];       
          $email_to = "info@company.com";
  
          $host = "ssl://smtp.gmail.com:465";
          $username = 'myEmail@company.pro';
          $password = 'passpass';
  
          $email_subject = "You have a new email from $email via company.com website";
          $message = $_POST['text']; 
  
          $headers = array ('From' =&gt; $email, 'To' =&gt; $email_to,'Subject' =&gt; $email_subject);
          /*$smtp = Mail::factory('smtp',
            array ('host' =&gt; $host,
              'auth' =&gt; true,
              'username' =&gt; $username,
              'password' =&gt; $password));*/
  
          //$mail = $smtp-&gt;send($email_to, $headers, $message);
  
          wp_mail( $email_to, $email_subject, $message );
  
          /*if (PEAR::isError($mail)) {
            echo($mail-&gt;getMessage());
          } else {
            echo("Message successfully sent!\n");
          }*/
      }
  }
  
  
  
  
  
  error_reporting(E_ALL);
  ini_set("display_errors", 1);
  </code></pre>
  
  <p>What part might be wrong? </p>