title: send email with php in a local host
body: <p>I want to send email with php using xampp.</p>
  
  <pre><code>&lt;html&gt;
     &lt;head&gt;
  
     &lt;/head&gt;
     &lt;body&gt;
  
     &lt;?php
      error_reporting(E_ALL ^ E_NOTICE);
      $to = $_POST['email_add'];
      //define the subject of the email
      $subject = $_POST['sbjct']; 
      //define the message to be sent. Each line should be separated with \n
      $message = $_POST['msg']; 
      //define the headers we want passed. Note that they are separated with \r\n
      $headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com";
  
  
      $mail_sent = @mail( $to, $subject, $message, $headers );
      echo $mail_sent ? "Mail sent" : "Mail failed";
      ?&gt;
      &lt;form action="send_email.php" method="post"&gt;
      Email Add&lt;input type="text" name="email_add" /&gt;
      Subject&lt;input type="text" name="sbjct" /&gt; &lt;br&gt;
       &lt;textarea name="msg" rows="9"  cols="20"&gt;&lt;/textarea&gt;&lt;br&gt;
  
      &lt;input type="submit" value="Send"/&gt;
      &lt;/form&gt;
  
      &lt;/body&gt;
  
      &lt;/html&gt;
  </code></pre>
  
  <p>It's not working. Is there something wrong with my code? </p>
  
  <p>I found some tutorials on the cloud, but it mentions SMTP and I do not understand it.</p>