I'm new to Bootstrap (apologies in advance) and what I want to do is quite simplistic. Capture details from FORM in HTML > call javascript on submit > call php to initiate POST > send email to my mail server.
My code to achieve this works in isolation, but when I embed these elements it into my main HTML/JS/PHP environment, I keep getting 'Sorry..mail server not responding' message from my PHP script.
This question is similar in nature to a previous thread but differs as my script always returns an error.
Here is the HTML handling FORM:
    <div class="container"> 
    <div id="contacts">
        <div class="row">   
     <!-- Alignment -->
            <div class="col-sm-offset-3 col-sm-6">
       <!-- Form itself -->
                <form name="sentMessage" class="well" id="contactForm"  novalidate>
                <legend>Contact Us v0.1</legend>
                <div class="control-group">
                    <div class="controls">
                        <input type="text" class="form-control" 
                        placeholder="Name" id="name" required
                        data-validation-required-message="Please enter your name" />
                        <p class="help-block"></p>
                    </div>
                </div>  
                <div class="control-group">
                    <div class="controls">
                        <input type="email" class="form-control" 
                        placeholder="Email" id="email" required
                        data-validation-required-message="Please enter your email" />
                    </div>
                </div>  
                <div class="control-group">
                    <div class="controls">
                        <input type="text" class="form-control" 
                        placeholder="Mobile No (Optional)" id="mobile"/>
                    </div>
                </div>                
               <div class="control-group">
                 <div class="controls">
                 <textarea rows="10" cols="100" class="form-control" 
                       placeholder="Message" id="message" required
               data-validation-required-message="Please enter your message" minlength="5" 
                       data-validation-minlength-message="Min 5 characters" 
                        maxlength="999" style="resize:none"></textarea>
        </div>
               </div>        
         <div id="success"> </div> <!-- For success/fail messages -->
        <button type="submit" class="btn btn-primary pull-right">Send</button><br />
          </form>
    </div>
      </div>
    </div>
   </div>
    <!-- Core JavaScript Files -->
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jqBootstrapValidation.js"></script>
    <script src="js/jquery.easing.min.js"></script> 
    <script src="js/jquery.scrollTo.js"></script>
    <script src="js/wow.min.js"></script>
    <!-- Custom Theme JavaScript -->
    <script src="js/custom.js"></script>
    <script src="js/contact_me.js"></script>
Here is contact_me.js
/*
  Jquery Validation using jqBootstrapValidation
   example is taken from jqBootstrapValidation docs 
  */
$(function() {
 $("input,textarea").jqBootstrapValidation(
    {
     preventSubmit: true,
     submitError: function($form, event, errors) {
      // something to have when submit produces an error ?
      // Not decided if I need it yet
     },
     submitSuccess: function($form, event) {
      event.preventDefault(); // prevent default submit behaviour
       // get values from FORM
       var name = $("input#name").val();  
       var email = $("input#email").val(); 
       var mobile = $("input#mobile").val();
       var message = $("textarea#message").val();
       var firstName = name; // For Success/Failure Message
           // Check for white space in name for Success/Fail message
        if (firstName.indexOf(' ') >= 0) {
       firstName = name.split(' ').slice(0, -1).join(' ');
         }        
     $.ajax({
                url: "./bin/contact_me.php",
                type: "POST",
                data: {name: name, email: email, mobile: mobile, message: message},
                cache: false,
                success: function() {  
                // Success message
                   $('#success').html("<div class='alert alert-success'>");
                   $('#success > .alert-success').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×")
                    .append( "</button>");
                  $('#success > .alert-success')
                    .append("<strong>Your message has been sent to dont.reply@cheerful.com. </strong>");
          $('#success > .alert-success')
            .append('</div>');
          //clear all fields
          $('#contactForm').trigger("reset");
          },
       error: function() {      
        // Fail message
         $('#success').html("<div class='alert alert-danger'>");
                $('#success > .alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×")
                 .append( "</button>");
                $('#success > .alert-danger').append("<strong>Sorry "+firstName+" it seems that my mail server is not responding...</strong> Could you please email me directly to <a href='mailto:dont.reply@cheerful.com?Subject=Message_Me from dontreply.com'>dont.reply@cheerful.com</a> ? Sorry for the inconvenience!");
            $('#success > .alert-danger').append('</div>');
        //clear all fields
        $('#contactForm').trigger("reset");
        },
           })
         },
         filter: function() {
                   return $(this).is(":visible");
         },
       });
      $("a[data-toggle=\"tab\"]").click(function(e) {
                    e.preventDefault();
                    $(this).tab("show");
        });
  });
/*When clicking on Full hide fail/success boxes */ 
$('#name').focus(function() {
     $('#success').html('');
  });
Here is contact_me.php
<?php
// check if fields passed are empty
if(empty($_POST['name'])        ||
   empty($_POST['email'])       ||
   empty($_POST('mobile'])      ||
   empty($_POST['message']) ||
   !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
   {
    echo "No arguments Provided!";
    return false;
   }
$name = $_POST['name'];
$email_address = $_POST['email'];
$mobile = $_POST['mobile'];
$message = $_POST['message'];
// create email body and send it    
$to = 'dont.reply@cheerful.com'; // put your email
$email_subject = "Contact form submitted by:  $name";
$email_body = "Hi, you have received a new message. \n\n".
                  "Here are the details:\n \nName: $name \n ".
                  "Mobile: $mobile \n ".
                  "Email: $email_address\n Message \n $message";
$headers = "From: Contact_Form_v1\n";
$headers .= "Reply-To: $email_address"; 
mail($to,$email_subject,$email_body,$headers);
return true;            
?>
my index.html is at root level, the contact_me.js is in folder root/js and my contact_me.php is in folder root/bin. Not sure if there is an issue with the php script not being found. My Host provide uses Linux servers.
Any help much appreciated.
