<?php
}else{
// found post data
$from=$_POST['sender'];
$to=$_POST['to'];
// send mail :
if (mail($to,$_POST['subject'],$_POST['message'],"From: $from\n")){
// display confirmation message if mail sent successfully
echo "Your mail sent to $to.";
}else{
// sending failed
echo "Your mail could not be sent.";
}
}
?>