<?php
// this is our handler of the form from above.
// localize the vars
$to = $_POST['to'];
$from = $_POST['from'];
$subject = $_POST['subject'];
$body = $_POST['body'];
// get headers
$header   = "From: ".$from ."\n";
$header  .= "Reply-To: ".$from."\r\n";
//check to make sure it went out
$sendcheck = mail($to, $subject, stripslashes($body), $header);
if($sendcheck)
{
echo "<p>Thank You!</p><p>Your mail has been sent.</p>";
}
else
echo "<h3>Error!</h3><p>Your email was not sent. </p>";
exit();
?> Â Â