Salve, non riesco a ricevere mail inviate dal sito.
Di seguito indico il codice HTML e PHP utilizzato.
HTML
<form id="contact-form" class="col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2 col-xs-12" action="send.php" method="post" name="send">
<div class="form-group">
<label for="name">NOME</label>
<input id="name" name="name" placeholder="Il Tuo Nome" class="form-control requiredField name input-label" data-new-placeholder="Your name" type="text">
<i class="fa fa-user"></i>
</div><!-- End name input -->
<div class="form-group">
<label for="mail">Email</label>
<input id="mail" name="email" placeholder="La Tua Mail" class="form-control requiredField email input-label" data-new-placeholder="Your email" type="text">
<i class="fa fa-envelope"></i>
</div><!-- End email input -->
<div class="form-group">
<label for="message">MESSAGGIO</label>
<textarea id="message" name="message" placeholder="Il Tuo Messaggio" class="form-control requiredField input-label" data-new-placeholder="Your message" rows="6"></textarea>
<i class="fa fa-comment"></i>
</div><!-- End textarea -->
<p><button name="submit" type="submit" class="btn btn-block btn-contact">INVIA <i class="fa fa-send-o"></i></button></p>
</form> <!-- /End Contact Form -->
PHP
<?php
$errors = '';
$myemail = 'mio_indirizzo@gmail.com';
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['message']))
{
$errors .= "\n Error: Required Field";
}
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
if (!eregi(
"^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$",
$email))
{
$errors .= "\n Error: Invalid Email Address";
}
if( empty($errors))
{
$to = $myemail;
$email_subject = "A New Message Awaits: $subject";
$email_body = "You have received a new message. Details are given below.\n Name: $name \n Email: $email \n Message: \n $message";
$headers = "From: $email";
mail($to, $email_subject, $email_body, $headers);
}
?>
Grazie del vostro aiuto.