title: Email not sending in form Bootstrap
body: <p>I have a form in Bootstrap 3 that's inside a modal. When I click the "Submit" button, it redirects to process.php which is supposed to send an email to my email address. It doesn't.</p>
  
  <p>Does anyone know why this happens? Here's the form:</p>
  
  <pre><code>&lt;div class="modal fade" id="contactPop" tabindex="-1" role="dialog" aria-labelledby="contactModal" aria-hidden="true"&gt;
       &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
             &lt;div class="modal-header"&gt;
                &lt;!-- Close button. --&gt;
                &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                &lt;!-- Title. --&gt;
                &lt;h3 class="modal-title" style="font-family: 'Lato', sans-serif; font-weight: 700;"&gt;
                   Contact Us &lt;small style="font-family: 'Lato', sans-serif; font-weight:400;"&gt; You matter to us.&lt;/small&gt;
                &lt;/h3&gt;
             &lt;/div&gt;
  
             &lt;!-- User input fields. --&gt;
             &lt;form class="contact" action="process.php" method="post"&gt;
             &lt;div class="modal-body"&gt;
                &lt;div class="row"&gt;
                   &lt;div class="col-sm-6"&gt;
                      &lt;label class="control-label"&gt;Subject&lt;/label&gt;
                      &lt;input type="text" class="form-control" required="required" placeholder="I aciddentally the website!" name="subject"&gt;
                   &lt;/div&gt;
                   &lt;div class="col-sm-6"&gt;
                      &lt;label class="control-label"&gt;Username&lt;/label&gt;
                      &lt;input type="text" class="form-control" required="required" placeholder="Notch" name="username"&gt;
                   &lt;/div&gt;
                &lt;/div&gt;
                &lt;br&gt;
  
                &lt;div class="row"&gt;
                   &lt;div class="col-sm-6"&gt;
                      &lt;label class="control-label"&gt;Message&lt;/label&gt;
                      &lt;textarea class="form-control" rows="8" style="resize: vertical;" required="required" placeholder="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam eget fermentum justo, sit amet semper." name="message"&gt;&lt;/textarea&gt;
                   &lt;/div&gt;
  
                   &lt;div class="col-sm-6"&gt;
                      &lt;label class="control-label"&gt;Email&lt;/label&gt;
                      &lt;input type="email" class="form-control" required="required" placeholder="johnsmith@example.com" name="email"&gt;
                   &lt;/div&gt;
  
                   &lt;div class="col-sm-6" style="line-height: 21px;"&gt;
                      &lt;br&gt;
                      &lt;p&gt;Responses are usually received within 1-2 business days.&lt;/p&gt;
                      &lt;p&gt;Please be as clear and concise as possible, in order to help us process your inquiry faster.&lt;/p&gt;
                   &lt;/div&gt;
                &lt;/div&gt;
             &lt;/div&gt;
  
             &lt;!-- Close &amp; submit buttons. --&gt;
             &lt;div class="modal-footer"&gt;
                &lt;button type="button" class="btn btn-info" data-dismiss="modal"&gt;&lt;i class="glyphicon glyphicon-remove"&gt;&lt;/i&gt; Close&lt;/button&gt;
                &lt;button type="button" value=" Send" class="btn btn-success" type="submit" id="submit"&gt;&lt;i class="glyphicon glyphicon-inbox"&gt;&lt;/i&gt; Submit&lt;/button&gt;
             &lt;/div&gt;
          &lt;/div&gt;
       &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>There's also the process.php that sends the form, which is here:</p>
  
  <pre><code>&lt;?php
  //add the recipient's address here
  $myemail = 'stanleyreale@gmail.com';
  
  //grab named inputs from html then post to #thanks
  if (isset($_POST['name'])) {
  $name = strip_tags($_POST['name']);
  $email = strip_tags($_POST['email']);
  $message = strip_tags($_POST['message']);
  echo "&lt;span class=\"alert alert-success\" &gt;Your message has been received, and we will get                 back to you as soon as possible. Here is what you submitted:&lt;/span&gt;&lt;br&gt;&lt;br&gt;";
  echo "&lt;stong&gt;Name:&lt;/strong&gt; ".$name."&lt;br&gt;";   
  echo "&lt;stong&gt;Email:&lt;/strong&gt; ".$email."&lt;br&gt;"; 
  echo "&lt;stong&gt;Message:&lt;/strong&gt; ".$message."&lt;br&gt;";
  
  //generate email and send!
  $to = $myemail;
  $email_subject = "Contact form submission: $name";
  $email_body = "You have received a new message. ".
  " Here are the details:\n Name: $name \n ".
  "Email: $email\n Message \n $message";
  $headers = "From: $myemail\n";
  $headers .= "Reply-To: $email";
  mail($to,$email_subject,$email_body,$headers);
  }
  ?&gt;
  </code></pre>
  
  <p>And then in the index there's also the javascript that is supposed to submit the form.</p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
       $(document).ready(function () {
  $("input#submit").click(function(){
      $.ajax({
          type: "POST",
          url: "process.php", //process to mail
          data: $('form.contact').serialize(),
          success: function(msg){
              $("#thanks").html(msg) //hide button and show thank you
              $("#form-content").modal('hide'); //hide popup  
          },
          error: function(){
              alert("failure");
          }
      });
  });
  });
    &lt;/script&gt;
  </code></pre>
  
  <p>If someone could help that would be greatly appreciated!</p>