Simple way is like this;
PHP Code:
<?php
if($email == "") {
echo "You must enter your email!";
} else {
mail();
}
?>
But you add as many error check as you like. Expanding on the above..
PHP Code:
<?php
if($name == "") {
echo "Give me your name dammit!";
}
if($subject == "") {
echo "Enter a subject!";
}
if($email == "") {
echo "You must enter your email!";
} else {
if($comments == ""){
echo "Comments - Empty!";
} else {
mail();
}
?>