I use lots of mail scripts in php. Unfortunately, if you allow users to enter their email address, suddenly you are vulnerable to spam injection. For an explanation as to why, see this really good article.
There's a simple way to fix this for your mail scripts.
Just using some quick replacement on your strings, you can do the following:
$email = $_POST['email']; $strip_chars = array("\r","\n"); $email = str_replace($strip_chars, "", $email);
And suddenly you're safe again.



or do it this
or do it this way:
$_POST['email'] = preg_replace("/\r/", "", $_POST['email']); $_POST['email'] = preg_replace("/\n/", "", $_POST['email']);
Post new comment