I know this is may sound very daft to genius minds that exist here, but I need some desperate assistance in this matter. Any help would be appreciated.
I have hosted ths simple script on my clients site, the form seems to work fine - BUT we are just not getting the information as an e-mail. Can someone give their valuable input please.
<?php
// get posted data into local variables
$EmailFrom = Trim(stripslashes($POST['email']));
$EmailTo = "justgetonwithitnow@hotmail.com";
$Subject = "Contact request from website";
$Name = Trim(stripslashes($POST['name']));
$Telephone = Trim(stripslashes($POST['tel']));
$Comments = Trim(stripslashes($POST['comments']));
// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (Trim($Name)=="") $validationOK=false;
if (Trim($Telephone)=="") $validationOK=false;
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 .= "E-mail ";
$Body .= $EmailFrom;
$Body .= "\n";
$Body .= "Telephone: ";
$Body .= $Telephone;
$Body .= "\n";
$Body .= "Comments: ";
$Body .= $Comments;
$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=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
Thanks Zillions 😃