I created the form in my HTML file below and also the PHP file below that. However I cannot seem to get it to send to email address listed as "$to".
I keep getting the message "Email not sent" which is what is supposed to return when the email doesn't send...but I don't know why.
<form method="POST" action="mailer.php" id="formid">
 <div class="row">
    <div class="col-md-6">
        <div class="form-group">
            <input type="text" class="form-control" name="name" placeholder="Your Name" required="">
        </div>
    </div>
    <div class="col-md-6">
        <div class="form-group">
            <input type="email" class="form-control" name="email" placeholder="Email" required="">
        </div>
    </div>
 </div>
  <div class="form-group">
    <textarea class="form-control" name="message" rows="8" placeholder="Message"></textarea>
  </div>
  <div class="center-content">
    <input type="submit" value="SEND" class="btn btn-lg">
  </div>
<?php
if(isset($_POST['submit'])) 
{
    $to = "myemail@email.com";
    $subject = "Customer Enquiry";
    $name_field = $_POST['name'];
    $email_field = $_POST['email'];
    $message = $_POST['message'];
    $body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";
    echo "Thanks for your enquiry! Expect a response within 24 hours.";
    mail($to, $subject, $body);
} 
else 
{
    echo "Email not sent";
}
?>
