tags:

views:

116

answers:

3

I am getting more and more spam emails recently. I already validate my email using regular expression, all the emails must be something like this: [email protected]

But the problem i have now is, there are alot spammers, type [email protected], [email protected], these emails are not existed, because i tried to send email to them.

How to avoid those email?

+5  A: 

You're barking up the wrong tree. The better way to stop spam is by filtering them out in other ways from the form. If you are not a fan of CAPTCHAs like reCAPTCHA, you should look into what is known as "Honeypots". Essentially, add an extra field to your form with a common name like "email" and hide it with CSS. Mark it as "leave blank" for anyone browsing with styles disabled. If the field has a value in it, it is most likely a bot, so throw the submission out. Voila. They work really well for your average mid-size website that spammers don't really care to specifically set out to beat. Check out this related question.

All things considered, I like the honeypots because it is usually enough to deter 99% of your spamming while not making your average user have to do anything. This is important.

To quickly answer your original question: the only way to verify the email is valid is to actually send out an email to that address and see if it bounces. It is generally not worth the hassle, however.

Paolo Bergantino
Best way to do it! Or if your site is rather unknown .. 2+7 = 9 etc... works if you're not the low hanging fruit doing it.
alex
A: 

If they are signing up for a newsletter or something that you will email them more than once I like to send a confirmation email to them which they must click a link to verify that it is a real email. If they dont confirm after a few days then you know you can delete it. If they do confirm then you know that it is a real person. You will still get bounce backs when you first email them but it will eliminate reoccurring bounce backs.

I also like CAPTCHAs or if you want something simpler ask them to enter the first letter of the title of your website (or some other word that will always remain the same on the page), it works for smaller to mid sized sites but is mostly effective.

Josh Curren
A: 

Short answer:

Use a CAPTCHA.

Long answer:

Well, you could do an MX lookup, where you find the server responsible for delivering email for their given domain, then query the mail-server to see if the address is valid. In a perfect world, this would be the ideal way to validate email addresses.

Unfortunately, as an anti-spam measure, most mail servers these days will respond to such a query with either all positives or all negatives.

This leaves us with really only one practical solution: CAPTCHAs.

EvanK