Email Verification

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jhame26
Forum Newbie
Posts: 1
Joined: Thu Nov 03, 2011 8:17 pm

Email Verification

Post by jhame26 »

Hi Guys, Sir and Madam! i just want to consult this convern, is there any way how I can validate the email if it is a spam or not? before they go to my database? is there any recommendations :)
User avatar
twinedev
Forum Regular
Posts: 984
Joined: Tue Sep 28, 2010 11:41 am
Location: Columbus, Ohio

Re: Email Verification

Post by twinedev »

When you say "is it spam or not", are you talking about mail coming being spam, or referring to just a made up e-mail someone is using to sign up to spam your site (ie, a forum)?

If you are talking the later:

The most basic is using a regex to make sure it is a correct format (search for e-mail regex)

Second, you can then do a call to make sure that the domain exists with something like checkdnsrr() (see http://us3.php.net/manual/en/function.checkdnsrr.php, in the comments about the 8th one down is sample email check code, not sure how good that one is)

Then you can use some type of service to see if the domain is listed on a blacklist (Never actually had to implement this, so not sure exactly what you would need to do).

One thing to do, visit sites that offer temp e-mails for signups, like http://www.guerrillamail.com/ , every month or so and add the domain they are using into your blacklist (currently it is sharklasers.com).

-Greg
Post Reply