This is what I use:

Code:

if(eregi("MIME-Version: ",$email.$subject.$comments)){die('Get out, spammer.');}
if(eregi("Content-type: ",$email.$subject.$comments)){die('Get out, spammer.');}
if (eregi("\r",$email) || eregi("\n",$email)) {
die("Get out, spammer.");
}
if (eregi("\r",$subject) || eregi("\n",$subject)) {
die("Get out, spammer.");
}

if (!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@' . '[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.' . '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)) {
header("Location: http://www.mydomain.com/template/mailer_failure.php");
exit();
}



Where $email is their email address, $subject is subject, and $comments is the body of the message.