if ($submit) {
//Here we add the send mail script
$from="From:$name<$mail>";
$tomail="mymail@dot.com";
if (mail($tomail,$subject,$body,$from)) echo "Thank You For using our mail form";
}else
//We added action=$PHP_SELF
//$PHPSELF means current page
//action normally contains the page to which the variables are sent
echo "";
?>