Validating email address with php


How many times have you heard of email being termed "the ultimate killer application"?Indeed, the impact that it has made on all of our lives in such a short period of time is immeasurable.Given such qualities, it isn't a surprise that email has become a defacto tool of business for communicating with its clientele.These days, users are expected to supply a valid email for just about everything, provided in exchange for the privilege of downloading software, learning more about the latest sales, and even for simply offering a comment to a favorite blogger's most recent entry.This approach is versatile and portable enough to be used whether we want to expand basic validating functions or add extra functionality to existing classes.A very quick snippet today because I've told two people to use this approach in the last few days and both of them told me they didn't know about it.Whatever the case, validating a visitor’s email address to see if it belongs to a real domain is always a good step to help you avoid, at least partially, several possible problems that arise when applications are receiving incoming bogus data.From cluttering up databases with invalid information, to sending newsletters or similar content to email addresses at nonexistent domains, headaches are surely going to come up from receiving fake email.", and my personal favorite, "blah", whenever possible.

a "personal_info" and a domain, that is [email protected] The length of the personal_info part may be up to 64 characters long and domain name may be up to 253 characters. The personal_info part contains the following ASCII characters.

To get a valid email id we use a regular expression /^\w ([\.-]?

So, as you can see in the above form, an email can be entered in.

I use the Javascript onblur() function to validate the email address once the user clicks away from the text box.

So once the user enters in the email and clicks away from the text box, s/he will be able to know if the email address is a valid email.

You must have an account to comment. Please register or login here!