title: Creaing php contact form
body: <p>I'm new to php to I've tried to write my own php contact form to learn. Obviously having troubles now, here's my code:</p>
  
  <pre><code>&lt;form action="mail-2.php" method="POST"&gt;
  &lt;p&gt;Your Name (required)&lt;/p&gt; &lt;input type="text" name="name"&gt;
  &lt;/br&gt;&lt;/br&gt;&lt;p&gt;Your Email (required)&lt;/p&gt; &lt;input type="text" name="email"&gt;
  &lt;/br&gt;&lt;/br&gt;&lt;p&gt;Phone&lt;/p&gt; &lt;input type="text" name="phone"&gt;
  &lt;/br&gt;&lt;/br&gt;
  &lt;p&gt;Message&lt;/p&gt;&lt;textarea name="message" rows="6" cols="25"&gt;&lt;/textarea&gt;&lt;br /&gt;
  
  &lt;/br&gt;&lt;/br&gt;
  &lt;input type="submit" name="saveForm" value="Send"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and php: mail-2.php</p>
  
  <pre><code>&lt;?php
  $to = "petermikhail96@gmail.com";
  $from = $_POST['email'];
  $name = $_POST['name'];
  $phone = $_POST['phone'];
  $message = $_POST['message'];
  $formcontent=" From: $name \n Phone: $phone \n Message: $message";
  $subject = "Contact Form";
  $mailheader = "From: $email \r\n";
  mail($to, $subject, $formcontent, $mailheader) or die("Error!");
  echo "Thank You!" . " -" . "&lt;a href='index.html' style='text-decoration:none;color:#4A148C;'&gt; Return Home&lt;/a&gt;";
  ?&gt;
  </code></pre>
  
  <p>can anyone help me to get this working? It goes to the thank you page after I click send but the email does not go through.</p>
  
  <p>Also I need to add an attachment to the form too but after several attempts I think I failed</p>