title: Receive email from PHP contact form
body: <p>I have no experience with php, I only do front-end development. I want to set up this contact form to send me emails. I am using an <a href="http://htmldog.com/techniques/formtoemail/" rel="nofollow">example from htmldog.</a></p>
  
  <p>This is what i have so far:</p>
  
  <pre><code>    &lt;form action="contact.php" method="post"&gt;
        &lt;div class="col-md-5 left"&gt;
          &lt;input name="sender" type="text" class="name" placeholder="FULL NAME"&gt;
          &lt;input name="senderEmail" type="text" class="email" placeholder="EMAIL"&gt;
          &lt;input name="senderPhoneNumber" type="text" class="number" placeholder="PHONE NUMBER"&gt;
        &lt;/div&gt;
        &lt;div class="col-md-7 right"&gt;
          &lt;textarea name="message" id="" cols="30" rows="10" placeholder="MESSAGE"&gt;&lt;/textarea&gt;
          &lt;input type="submit" class="submit" name="submit" value="SEND"&gt;
        &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>This is the php code:</p>
  
  <pre><code>&lt;?php
  
  if($_POST["submit"]) {
      $recipient="test@mailinator.com";
      $subject="Contact form";
      $sender=$_POST["sender"];
      $senderEmail=$_POST["senderEmail"];
      $senderPhoneNumber=$_POST["senderPhoneNumber"];
      $message=$_POST["message"];
  
      $mailBody="Ime: $sender\nEmail: $senderEmail\nTelefon: $senderPhoneNumber\n\n$message";
  
      mail($recipient, $subject, $mailBody, "From: $sender &lt;$senderEmail&gt;");
  }
  
  ?&gt;
  </code></pre>
  
  <p>All of this is located in the contact.php file which displays the whole contact page. The php part is at the very beginning of the file, before the <code>&lt;!DOCTYPE html&gt;</code> declaration.</p>
  
  <p>EDIT: sorry for not being clear enough, the form is not working for some reason, i was wondering if its maybe some obvious coding error or do you see any other reason why it wouldn't work?</p>
  
  <p>Its shared hosting.</p>