title: How to send mail via sendmail path
body: <p>Excuse me, I am learning to build a simple contact form on my customed website. I want to send an email via mail() but no mails are received. How do I set it via Sendmail path? </p>
  
  <p><a href="http://php.net/manual/en/function.mail.php" rel="nofollow noreferrer">PHP mail official manual</a></p>
  
  <pre><code>&lt;?php
  if (isset($_POST['email'])) {
  
  //Email information
  $to="admin@example.com";
  $subject='New Form Submission';
  $name=$_POST['name'];
  $email=$_POST['email'];
  $phone=$_POST['phone'];
  $message=$_POST['message'];
  
  //send email
  mail($to,$subject,$message);
  
  header('Location:success.html');
  }
  
  ?&gt;
  </code></pre>