<HTML>
<HEAD>
<TITLE> Example 7 </TITLE>
</HEAD>
<BODY>
<?
// the code below checks the $subject field from a Web form
// if the $subject is not blank the message is sent
// else (the subject field is blank) an error is sent back to the user
if ($subject <> "") {
mail("dcook@www.utexas.edu", $_POST[subject], $_POST[message]);
// don't forget to have your php script print something
// if you just send mail the users will see an empty page
print("You message has been sent\n");
} else {
print("The subject field was blank. You must complete the subject field");
}
?>
</BODY>
</HTML>