title: @mail not sending mail in php
body: <p>This is the first time I am using the mail function. I tried to send a mail using this and the code tells me it's "successfully sent", but I didn't receive any mail. I'm confused reading lots of articles on this. Please help me.</p>
  
  <pre><code>&lt;?php
    if(isset($_POST['author'])&amp;&amp; isset($_POST['subject'])&amp;&amp; isset($_POST['text'])) {
      //Email
      $email_to = "lucy@yahoo.com";
      $email_subject = "Query From HYPERMARKETS";
      $name = $_POST['author']; // required
      $sub = $_POST['subject']; // required
      $comments = $_POST['text']; // required
  
      echo "POST:".$name.$sub.$comments;
      $error_message = "";
  
      $string_exp = "^[a-z .'-]+$";
      if(!strcmp($string_exp,$name)) {
        $error_message .= 'The Name you entered does not appear to be valid.&lt;br /&gt;';
      }
  
      if(strlen($comments) &lt; 5) {
        $error_message .= 'The Comments you entered do not appear to be valid.&lt;br /&gt;';
      }
  
      if(strlen($error_message) &gt; 0) {
        echo ("&lt;center&gt;&lt;table border=1 cellspacing=5 cellpadding=5&gt;&lt;tr&gt;&lt;th&gt;$error_message&lt;/th&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/center&gt;");
      }
      $email_message = "Form details below.\n\n";
      $email_message .= "Name: ".$name."\n";
      $email_message .= "Subject: ".$sub."\n";
      $email_message .= "Comments: ".$comments."\n";
  
  
      // create email headers
      $headers = "From: mary@yahoo.com \r\n Reply-To: mary@yahoo.com \r\n" ;
      if(@mail($email_to, $email_subject, $email_message, $headers))
        echo "&lt;center&gt;&lt;table border=1 cellspacing=5 cellpadding=5&gt;&lt;tr&gt;&lt;th&gt;MESSAGE SENT SUCCESSFULLY&lt;/th&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/center&gt;";
      else
        echo "&lt;center&gt;&lt;table border=1 cellspacing=5 cellpadding=5&gt;&lt;tr&gt;&lt;th&gt;MESSAGE NOT SENT&lt;/th&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/center&gt;";
    }
    else
      echo ("&lt;center&gt;&lt;table border=1 cellspacing=5 cellpadding=5&gt;&lt;tr&gt;&lt;th&gt;FILL ALL THE FIELDS..!!&lt;/th&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/center&gt;");
  ?&gt;
  </code></pre>
  
  <p>Hey I have configured my php.ini file as</p>
  
  <pre><code>[mail function]
  
     sendmail_from = postmaster@localhost
     SMTP = localhost
     smtp_port = 25
     sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
     sendmail_path = "C:\xampp\mailtodisk\mailtodisk.exe"
  </code></pre>
  
  <p>It still doesnt work.</p>