to better help you get help from others, you should tell us what errors your getting, if your getting any. just saying "doesnt work" isnt very helpfull to us.
heres the problems i see
$mail = @mail($to,$_POST['name'],$_POST['message'],$header
s);
thats a parse error. it should be like this
$mail = mail($to, $_POST['name'], $_POST['message'], $headers);
if you debugging, dont use the @ symbol to suppress errors. you want to see errors because they help you solve your problem.
you also dont check whether the mail() function was successfull or not.
try this
<!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>
<?php
if ($_GET['post'] == 'yes') {
$to = "email@email.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';
}
}
?>
<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" />
</body>
</html>