This question already has an answer here:
- Sending email from localhost 4 answers
Im using a mailing form but the mail cannot be sent to gmail inbox !!
here is the code i'm using:
<?php
if (isset($_POST['send'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$emailTo = 'example@gmail.com';
$subject = 'Sujet: '.$name;
$body = "Full Name: $name
Message: $message
Sent by : $email";
$headers = 'De: ' .' <'.$email.'>' . "
";
if(mail($emailTo, $subject, $body, $headers)){
echo "Success";
}else{
echo "Error";
}
}
?>
</div>