I tried to do:
<?php
$name = $_POST['yourname'];
$email = $_POST["youremail"];
$message = $_POST["yourmessage"];
$to = "[email protected]";
$subject = "messages";
mail($to, $subject, $message,$email);
?>
And failed? What am I doing wrong? I am trying on live host – Cpanel
2
Answers
I’ve run into the same problem a few times, and for me this seems to do the trick.
Adding the
"From: "
and the quotes around subject for whatever reason make it work.