Hi, I'm sure there's something really simple wrong with this, as testing on one online server it works fine and I get the email but when testing the exact same script on my server it doesn't send the mail.
Here's my code:
<?php
//collect vars
$myName = $_POST['name'];
$myEmail = $_POST['email'];
//generating $msg var
$msg = "Enquiry form";
$msg .= "----------------------------------------------\n";
$msg .= "Name: $myName \n";
$msg .= "Email: $myEmail \n";
//hardcoded mail vars
$recipient = "test@mydomain.com";
$subject = "submission from website";
$mailheaders = "From: Website <test@mydomain.com> \n";
$mailheaders .= "Reply-To: $_POST[email]";
//send it
mail($recipient,$subject,$msg,$mailheaders);
//redirect it if successfull
header("Location: http://www.mydomain.com/forms/form1.htm");
?>
I tried adding:
$mailheaders .= 'X-Mailer: PHP/' . phpversion();
But it still doesn't work, any ideas?
Thanks for your time 😉