If you want to check your form submissions for likely webspam, use the “maybeSpam” method. For example:
IF ($message->maybeSpam()): echo "Not sending message: might be spam."; ELSE: $message->queue(); ENDIF;
If there’s only a specific bit of text that you want checked for spamminess, you can give that text to the method.
$comment = $_POST['comment']; IF ($message->maybeSpam($comment)): echo "Not sending message: might be spam."; ELSE: $message->queue(); ENDIF;
- Any text with six or more URLs in it will be considered spammy.
- Any text that contains a phpBB-style URL (“[URL= ]”) will be considered spammy.
- If the client computer is in a list of spam sender IP addresses, the text will be considered spammy.
Note that you don’t have to not send the message when you discover that it’s spammy. You might just choose to send it to a smaller list of people. It’s possible (though unlikely) that spammy text isn’t really spam.