title: PHP Contact Form Failing
body: <p>I'm wondering what is going wrong in this contact form. I'm not sure why, but it constantly defaults to the <code>else</code> and says <code>Something went wrong, please try again later.</code> I can't figure out why, and the error_log isn't showing anything. Is there anything glaringly obvious I'm missing? I'm pretty new to PHP.</p>
  
  <p>PHP</p>
  
  <pre><code>&lt;?php
      $name = $_POST['name'];
      $email = $_POST['email'];
      $phone = $_POST['phone'];
      $message = $_POST['message'];
      $captcha = $_POST['captcha'];
      $from = 'From: HankSmith.com Contact Form'; 
      $to = 'thatbraxjohnsonguy@gmail.com'; 
      $subject = 'HANK SMITH CONTACT FORM';
  
      $body = "
              From: $name\n 
              E-Mail: $email\n 
              Phone: $phone\n
              Message: $message\n";
  
      if ($_POST['submit'] and $captcha == 4) {                
          if (mail ($to, $subject, $body, $from)) { 
          echo '&lt;p style="margin-top: 150; text-align:center; font-size: 18px;"&gt;Your message has been sent! Click &lt;a href="../index.php"&gt;here&lt;/a&gt; to return to the website.&lt;/p&gt;';
      } else { 
          echo '&lt;p&gt;Something went wrong, try again later!&lt;/p&gt;'; 
      }
  }
  ?&gt;
  </code></pre>
  
  <p>HTML Form</p>
  
  <pre><code>            &lt;form class="contactform" method="post" action="php/contact.php"&gt;
                  &lt;h3&gt;Name&lt;/h3&gt;
                  &lt;input class="form inputboxes" type="text" name="name"&gt;
                  &lt;h3&gt;Email&lt;/h3&gt;
                  &lt;input class="form inputboxes" type="text" name="email"&gt;
                  &lt;h3&gt;Phone&lt;/h3&gt;
                  &lt;input class="form inputboxes" type="text" name="phone"&gt;
                  &lt;h3&gt;Message&lt;/h3&gt;
                  &lt;textarea class="form inputboxes" name="message"&gt;&lt;/textarea&gt;
                  &lt;h3 class="captchastyle"&gt;Are you real? What is 2 + 2?&lt;/h3&gt;&lt;input class="captcha captchastyle" type="text" name="captcha" maxlength="1"&gt;
                  &lt;input class="form submit" name="submit" type="submit" value="Submit"&gt;
              &lt;/form&gt;
  </code></pre>