Not a function as such. Something I add to combat mail injection spammers. I've since added more but this is the version I have at hand:
PHP Code:
$email = preg_replace("/\r/", "", $email);
$email = preg_replace("/\n/", "", $email);
if (eregi("cc", $email) || eregi("bcc", $email) ||
eregi("to", $email) || eregi("Content-Type", $email))
die("Sorry, there was a problem with your message being sent.
Please click <a href=\"javascript:history.go(-1)\">here</a> to try again");
__________________