PHP message sends message as success, but no messages received?
Hi I have simple contact form for email on my site, and the form works
including the success of a message sent,however, I am not receiving email
to the designated webemail server. I am running the latest PHP. Do some
webservers cache mail or is there some error in this code I am not seeing.
<?php
$EmailFrom = "email@mydomain.com";
$EmailTo = "email@mydomain.com";
$Subject = "Contacting Me";
$Name = Trim(stripslashes($_POST['Name']));
$Tel = Trim(stripslashes($_POST['Tel']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));
// 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 .= "Tel: ";
$Body .= $Tel;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$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=http:blake-schermer.com\home">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
<div id="contact-area">
<form method="post" action="contactengine.php">
<label for="Name">Name:</label>
<input type="text" name="Name" id="Name" />
<label for="Email">Email:</label>
<input type="text" name="Email" id="Email" />
<label for="Message">Thought:</label><br />
<textarea name="Message" rows="20" cols="20"
id="Message"></textarea>
<input type="submit" name="submit" value="Transmit"
class="submit-button" />
</form>
<div style="clear: both;"></div></div>
No comments:
Post a Comment