title: PHP mail function is not working on my server?
body: <p>My mail function is on online server. It was working fine. But not now. I am confused why it has stopped sending mail. It shows the message that email sent, but no email is received in inbox. </p>
  
  <p><strong>Here is my php code:</strong></p>
  
  <pre><code>&lt;?php
  if (isset($_POST['submit'])) {
      $name = $_POST['name'];
      $email = $_POST['email'];
      $phone = $_POST['phone'];
      $message = $_POST['message'];
  
      $headers = "From: " . $email . "\n"; //from address
      $to = ""; //my mail id
      $headers .= "MIME-Version: 1.0\n";
      $headers .= "Content-type: text/html; charset=iso-8859-1 \n";
      $subject = "Test mail";
  
      $body = '&lt;html&gt;
          &lt;head&gt;
              &lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
              &lt;title&gt;"."&lt;h3&gt;"."Hello Test,."&lt;/h3&gt;".
      &lt;/title&gt;
          &lt;/head&gt;
          &lt;body&gt;&lt;p&gt;&lt;/p&gt;
              &lt;p style="color: #00CC66; font-weight:600; font-style:italic; font-size:14px; float:left; margin-left:7px;"&gt;You have received an inquiry from your website.  Please review the contact information below.
  
      :&lt;/p&gt;';
      if (mail($to, $subject, $body, $headers)) {
          ?&gt;
          &lt;h3 style="color:#d96922; font-weight:bold; height:0px; margin-top:1px;"&gt;Thank You For Contacting us!!&lt;/h3&gt;
  
          &lt;?php
      } else {
  
          print_r(error_get_last());
      }
  }
  </code></pre>
  
  <p>What's wrong with it? Please help me to find out the solution. And also help me to echo error? </p>