Formularz kontaktowy PHP - problem z wysyłką

0

Czołem, potrzebuję waszej pomocy. Chciałem wykorzystać gotowy skrypt ze strony z małymi modyfikacjami jednak nie wysyła maili ze strony. Po kliknięciu w przycisk 'Wyślij' nie dzieje się nic Może ktoś podpowie co robię źle.

Kod HTML:

<script>
$(document).ready(function() {
  $("html").on("submit","#contact_form",function(e){
    e.preventDefault();
    $("#send_form_status").html('').hide();
    var data=$("#contact_form").serialize();
    $.post("/send_form.php",data,function(res){
      $("#send_form_status").html(res.msg).show();
      if(res.status==1){ 
        $("#contact_form")[0].reset();
      } 
    });
  });
});
</script>

<div id="send_form_status"></div>
<form method="post" action="/send_form.php" id="contact_form">
     <div><label for="name">Imię i nazwisko</label></div>
     <div><input type="text" name="name" id="name" class="formField" /></div>

     <div><label for="phone">Numer telefonu</label></div>
     <div><input type="text" name="phone" id="phone" class="formField" /></div>

     <div><label for="email">Adres email do wysyłki</label></div>
     <div><input type="text" name="email" id="email" class="formField" /></div>

     <div><label for="ulica">Ulica</label></div>
     <div><input type="text" name="ulica" id="ulica" class="formField" /></div>

     <div><label for="numer">Numer domu / mieszkania</label></div>
     <div><input type="text" name="numer" id="numer" class="formField" /></div>

     <div><label for="miasto">Miasto</label></div>
     <div><input type="text" name="miasto" id="miasto" class="formField" /></div>

     <div><label for="kod">Kod pocztowy</label></div>
     <div><input type="text" name="kod" id="kod" class="formField" /></div>

     <div><button type="submit">Wyślij</button></div>
</form>

Kod PHP (send_form.php), tak adres do wysyłku ustawiam poprawny :):

<?php
header("content-type: application/json; charset=utf-8");
$name=isset($_POST['name']) ? $_POST['name'] : "";
$email=isset($_POST['email']) ? $_POST['email'] : "";
$phone=isset($_POST['phone']) ? $_POST['phone'] : "";
$ulica=isset($_POST['ulica']) ? $_POST['ulica'] : "";
$numer=isset($_POST['numer']) ? $_POST['numer'] : "";
$miasto=isset($_POST['miasto']) ? $_POST['miasto'] : "";
$kod=isset($_POST['kod']) ? $_POST['kod'] : "";

if($name && $email && $phone && $message){
 $headers = "MIME-Version: 1.0\r\nContent-type: text/plain; charset=utf-8\r\nContent-Transfer-Encoding: 8bit";
 $message_body="Formularz kontaktowy wysłany ze strony \n";
 $message_body.="Imię i nazwisko: $name\n";
 $message_body.="Adres email: $email\n";
 $message_body.="Numer telefonu: $phone\n\n";
 $message_body.=$ulica\n;
 $message_body.=$numer\n;
 $message_body.=$miasto\n;
 $message_body.=$kod\n;
 if(mail("[email protected]","Formularz kontaktowy",$message_body,$headers)){
 $json=array("status"=>1,"msg"=>"<p class='status_ok'>Twój formularz został pomyślnie wysłany.</p>");
 }
 else{
 $json=array("status"=>0,"msg"=>"<p class='status_err'>Wystąpił problem z wysłaniem formularza.</p>"); 
 }
}
else{
 $json=array("status"=>0,"msg"=>"<p class='status_err'>Proszę wypełnić wszystkie pola przed wysłaniem.</p>"); 
}
echo json_encode($json);
exit;
?>
0
$("#contact_form").on("submit",function(e){

1 użytkowników online, w tym zalogowanych: 0, gości: 1