[FONT=Verdana]I implemented mailer.php.
It seems to work partly.
When you click on http://www.paithailand.info/contact_mailer.php, you see a rudimental form.[/FONT][FONT=Verdana][/FONT][FONT=Verdana]Part of the code in that page[/FONT]
<form action="mailer.php" method="post">
Your Name: <input type="text" name="name"><br>
<br>
Your Email: <input type="text" name="email"><br>
<br>
Your Message:<br> <textarea name="message" rows="5" cols="30"></textarea><br>
<input type="submit" name="submit" value="Submit">
</form>
When you submit the page the “mailsuccess” page is shown.
That’s great but I do not get an email!
My code in mailer.php:
<?PHP
$to = "postmaster@paithailand.info";
$subject = "Results from your Request Info form";
$headers = "From: PaiThailand.info";
$forward = 1;
$location = "http://www.paithailand.info/mailsuccess.php";
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.
";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "
";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "
";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thank you for submitting our form. We will get back to you as soon as possible.";
}
?>
[SIZE=4]I think I did exactly what is described on http://www.kirupa.com/web/form_mailer.htm
I don’t see what I did wrong.
Hope you can help me or maybe you know a better script…[/SIZE]