PHP联系表,不发送电子邮件[重复]

This question already has an answer here:

I have been trying to make my first contact form and after hours of googling I can't seem to find the error in my code why it's not working.

My php code:

<?php
$to = 'llavert@gmail.com'; 
$from = strip_tags($_POST['email']); 
$name = strip_tags($_POST['name']);
$adress = strip_tags($_POST['address']);
$city = strip_tags($_POST['city']);
$subject = strip_tags($_POST["subject"]);
$message = strip_tags($_POST['message']);
$header = "From: noreply@example.com
"; 
$header.= "MIME-Version: 1.0
"; 
$header.= "Content-Type: text/html; charset=ISO-8859-1
"; 
$header.= "X-Priority: 1
"; 
mail($to, $subject, $message, $header);
print_r(error_get_last());

?>

My html form:

<form method="post" action="mailer.php">
                        <input type="text" class="col-md-13 col-xs-12 name" name='name' placeholder='Naam *'/>
                        <input type="text" class="col-md-13 col-xs-12 Email" name='email' placeholder='Email *'/>
                        <input type="text" class="col-md-13 col-xs-12 name" name='address' placeholder='Straat en huisnummer *'/>
                        <input type="text" class="col-md-13 col-xs-12 Email" name='city' placeholder='Postcode en gemeente *'/>
                        <input type="text" class="col-md-12 col-xs-12 Subject" name='subject' placeholder='Onderwerp *'/>
                        <textarea type="text" class="col-md-12 col-xs-12 Message" name='message' placeholder='Bericht aan BDS bvba *'></textarea>
                        <div class="cBtn col-xs-12">
                            <ul>
                                <li class="clear"><a href="#"><i class="fa fa-times"></i>Formulier legen</a></li>
                                <li class="send" name="submit" type="submit" value="Send"><i class="fa fa-share"></i>Bericht sturen</a></li>
                            </ul>
                            <br><br><br><br><br><br><br><br><br>

                        </div>
                    </form>
</div>

From the manual

It is important to note that just because the mail was accepted for delivery, it does NOT mean the mail will actually reach the intended destination.

It is most likely that your local mail server is not set up correctly.