Php function for validating email addresses

Using a script for validating email addresses is a good start to email address validation, but though it can tell you an email address is technically valid it cannot tell you if it is in use.You might benefit from checking in more depth, for example seeing if a domain name is registered.In order to check that email addresses conform to these guidelines, we'll need to use regular expressions.

php function for validating email addresses-87

The "local-part" of an email address must be between 1 and 64 characters in length and may be made up in any one of three ways.

It can be made up of a selection of characters (and only these characters) from the following selection (though the period can not be the first of these): Or, it can be made up of a quoted string containing any characters except "\".

You can now validate email addresses entered into your site against the specifications that define email addresses (more or less - domain names that start with a number are supposed to be invalid, but do exist).

Finally, please do remember that because an email valid does not mean it is in use.

A domain name may not be over 255 characters in total.

Comments