This question already has an answer here:
I'm trying to mail some information from a contact form via this code
<?php
// Check for empty fields
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['phone']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
{
echo "No arguments Provided!";
return false;
}
$name = $_POST['name'];
$email_address = $_POST['email'];
$phone = $_POST['phone'];
$message = $_POST['message'];
// Create the email and send the message
$to = 'Mymail@mydomain.com'; //
$email_subject = "Contacto web: $name ";
$email_body ="$email_address\n\nPhone: $phone\n\nMessage:\n$message";
$headers = "from: Noreply@mydomain.com\n";
$headers .= "Reply-To: $email_address";
mail($to,$email_subject,$email_body,$headers);
?>
the mail seems to be coming out but i'm getting nothing. i'm using HTMl and js for validations.
Aucun commentaire:
Enregistrer un commentaire