title: PHP Contact Form - no emails sent, is it actually submitting?
body: <p>This might seem like such an amateur thing, but I am an amateur when it comes to php...</p>
  
  <p>Basically a website I'm creating for an organisation I'm a part of needs a contact form, because I'm always trying to learn I'd prefer to have made the code myself rather than just get some plugin. However my code doesn't quite seem to work.</p>
  
  <p>Also first post, I'm pretty sure this isn't a duplicate due to it being different code, I have been using posts on this site to try get it to work but no luck, so thought best to post my code and hopefully people with more brain cells than me can help</p>
  
  <p>Here's the html for the page itself:</p>
  
  <pre><code>&lt;form method="post" action="contactengine.php"&gt;
      &lt;label for="Name"&gt;&lt;h2&gt;Your Name:&lt;/h2&gt;&lt;/label&gt;
      &lt;input type="text" name="Name" id="Name" placeholder="Please Enter Your Name"/&gt;
  
      &lt;label for="Email"&gt;&lt;h2&gt;Your Email:&lt;/h2&gt;&lt;/label&gt;
      &lt;input type="email" name="Email" id="Email" placeholder="Please Enter Your Email Address"/&gt;
  
      &lt;label for="Message"&gt;&lt;h2&gt;Message:&lt;/h2&gt;&lt;/label&gt;&lt;br /&gt;
      &lt;textarea name="Message" rows="20" cols="20" id="Message"&gt;&lt;/textarea&gt;
  
      &lt;input type="submit" name="submit" value="Submit" class="submit-button" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The PHP:</p>
  
  <pre><code>&lt;?php
  
      $EmailFrom = "webmaster@temporary.co.uk";
      $EmailTo = "webmaster@temporary.co.uk";
      $Subject = "Contact Form Submission";
      $Name = Trim(stripslashes($_POST['Name'])); 
      $Email = Trim(stripslashes($_POST['Email'])); 
      $Message = Trim(stripslashes($_POST['Message'])); 
  
      $headers  = 'MIME-Version: 1.0' . "\r\n";
      $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  
      // validation
      $validationOK=true;
      if (!$validationOK) {
        print "&lt;meta http-equiv=\"refresh\" content=\"0;URL=error.htm\"&gt;";
        exit;
      }
  
      // prepare email body text
      $Body = "";
      $Body .= "Name: ";
      $Body .= $Name;
      $Body .= "\n";
      $Body .= "Email: ";
      $Body .= $Email;
      $Body .= "\n";
      $Body .= "Message: ";
      $Body .= $Message;
      $Body .= "\n";
  
      // send email 
      $success = mail($EmailTo, $Subject, $Body, "From: &lt;$EmailFrom&gt;");
  
      // redirect to success page 
      if ($success){
        print "&lt;meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\"&gt;";
      }
      else{
        print "&lt;meta http-equiv=\"refresh\" content=\"0;URL=error.htm\"&gt;";
      }
      ?&gt;
  </code></pre>
  
  <p>I feel quite stupid because there's loads of literature on creating working contact forms but none of them seem to work</p>
  
  <p>I'm hosted on 1and1 if that makes any difference?</p>
  
  <p>Thanks in advance</p>
  
  <p>EDIT: Okay I forgot to mention the problem: emails just aren't delivering, so I don't actually know if success is working or not, I've tried different email addresses, checked spam the whole shabang - so I'm struggling to work out what's going wrong on it</p>