No expert here, form says it submitted but no email received and I've tried a couple of different email addresses. Thank you for looking...
<?php
$EmailFrom = Trim(stripslashes($POST['contact-email']));
$EmailTo = "my@email.com";
$Subject = "Contact from mysite.com";
$Name = Trim(stripslashes($POST['contact-name']));
$Subject = Trim(stripslashes($POST['Subject']));
$Email = Trim(stripslashes($POST['contact-email']));
$Message = Trim(stripslashes($_POST['contact-body']));
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Subject: ";
$Body .= $Subject;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=thanks.php\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.php\">";
}
?>