Email Address - Validation

Validation

Not only are email addresses used in a mail client or on a mail server, but also used in websites where a user-supplied email address is often validated.

An email address is generally recognized as having two parts joined with an at-sign (@); this in itself is a basic form of validation. However, the technical specification detailed in RFC 822 and subsequent RFCs go far beyond this, offering very complex and strict restrictions.

Trying to match these restrictions is a complex task, often resulting in long regular expressions.

This means that many mail servers adopt very relaxed validation that allows and handles email addresses that are disallowed according to the RFC and instead verify the email address against relevant systems such as DNS for the domain part or using callback verification to check if the mailbox exists.

Conversely, many websites check email addresses much more strictly than the standard specifies, rejecting addresses containing valid characters like + or / signs, or setting arbitrary length limitations (e.g., 30 characters). RFC 3696 was written to give specific advice for validating internet identifiers, including email addresses.

With many browsers now having implemented support for HTML5 forms, using the new 'email' state of the input element allows email address validation to be handled by the browser.

Read more about this topic:  Email Address