PROBLEM Warning: mail() [function.mail]: SMTP server response: 501 5.5.4

hI guys

I get the error message above and I’m sure it has to do with the function below which a USER’S EMAIL ADDRESS is run through - to avoid spam

If I cut out the function below everything works FINE.

SO any of you experts can tell me which of the php functions below are causign this problem ?

Thank you !

// special check for email address:		
   function check_email($data)
	$data = trim($data);
       $data = stripslashes($data);
       $data = htmlspecialchars($data);
	$data = htmlentities($data);
	$data = strip_tags($data);
        $data = nl2br($data);
        return $data;

I ran couple of email addresses through those functions and they did not alter the data.

Can you check to see the data going in and coming out? Just put echo $data at the beginning and again at the end just before return.