form mail
Posted: Fri Feb 18, 2005 8:15 pm
I can't seem to figure out whats wrong with the following script. It keeps telling me "email didnt send", but I can figure out why(no actual errors produced by php). Any ideas would be appreciated
Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Form Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form action="Form1.php?post=yes" method="post">
<p>Your name:
<input type="text" name="name" />
</p>
<p>Your email:
<input type="text" name="email" />
</p>
<p>Message:
<textarea name="message" id="message"></textarea>
<input type="submit" />
</form>
<?php
if ($_GETї'post'] == 'yes') {
$to = "jts3793@hotmail.com";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$_POSTї'email']."\r\n";
$mail = mail($to, $_POSTї'name'], $_POSTї'message'], $headers);
if ($mail) {
echo "Thank you, we will get back to you as soon as possible <br /> You sent the following information <br />" . $_POSTї'name'] . "<br /> " . $_POSTї'email'] . "<br />" . $_POSTї'name'] . "<br />";
echo "<a href="Form1.php?post=no">Display the form</a>";
exit;
}
else {
echo 'email didnt send';
}
}
?>
</body>
</html>