title: Not Receiving Email From PHP Form
body: <p>I am not receiving emails from my php form / html. I am new to making these forms, and I am wondering where I went wrong. The form sets up fine on a live site, and the submit button takes me back to the home page, which is what I want. Would anyone be able to help me figure out why I am not receiving the emails?</p>
  
  <p>Here is the html : </p>
  
  <p>`</p>
  
  <pre><code>&lt;section class="contact-container"&gt;
              &lt;div class="container mtb"&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-md-8 wow fadeInLeft"&gt;
                          &lt;h4&gt;Get in touch&lt;/h4&gt;
                          &lt;hr&gt;
                              &lt;p&gt;Leave a comment, review, or general musings.&lt;/p&gt;&lt;br /&gt;
  
  
  
  &lt;form id="contact_form" action="websitehere"  method="post"&gt;
      &lt;label&gt;Name: &lt;input class="textfield" name="name" type="text" value="" /&gt;&lt;/label&gt; 
      &lt;label&gt;Email: &lt;input class="textfield" name="email" type="text" value="" /&gt;&lt;/label&gt; 
      &lt;label&gt;Message: &lt;textarea class="textarea" cols="45" name="message" rows="5"&gt;&lt;/textarea&gt;&lt;/label&gt; 
      &lt;input class="button" name="submit" type="submit" value="Submit" /&gt;
  &lt;/form&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>And here is the PHP: </p>
  
  <pre><code>&lt;?php
      if (isset($_POST["submit"])) {
          $name = $_POST['name'];
          $email = $_POST['email'];
          $message = $_POST['message'];
          $human = intval($_POST['human']);
  
          $to = 'emailaddress@email.com'; 
          $subject = 'Message for the author ';
  
          $body = "From: $name\n E-Mail: $email\n Message:\n $message";
  
          // Check if name has been entered
          if (!$_POST['name']) {
              $errName = 'Please enter your name';
          }
  
          // Check if email has been entered and is valid
          if (!$_POST['email'] || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
              $errEmail = 'Please enter a valid email address';
          }
  
          //Check if message has been entered
          if (!$_POST['message']) {
              $errMessage = 'Please enter your message';
          }
          //Check if simple anti-bot test is correct
          if ($human !== 5) {
              $errHuman = 'Your anti-spam is incorrect';
          }
  
  // If there are no errors, send the email
  if (!$errName &amp;&amp; !$errEmail &amp;&amp; !$errMessage &amp;&amp; !$errHuman) {
      if (mail ($to, $subject, $body, $from)) {
          $result='&lt;div class="alert alert-success"&gt;Thank You! I will be in touch&lt;/div&gt;';
      } else {
          $result='&lt;div class="alert alert-danger"&gt;Sorry there was an error sending your message. Please try again later&lt;/div&gt;';
      }
  }
      }
  ?&gt;
  </code></pre>