Check that an email address is valid
It is very common to have to verify that an email address is valid. This means making sure it actually exists and is being used by someone. Today there are several tools to verify an email, either directly online and free of charge, or on demand on your website, or for mass verification of an email list. In all these cases, the test of the validity of the email address that is carried out is divided into two major steps.
The validity of the address format
An email address must first respect established formatting rules. For example, an email address that ends with a dot, or that contains two dots in a row, is not correct. There are sites you can go to for more information. To test the format, we cut the email address (example email@example.com) into three elements :
- The local part located before the at sign (example “jean94”) ;
- The at sign @, which can also be called “at” ;
- The domain name corresponding to the email server of the company hosting this email (example : « domain.com »).
These three elements are mandatory, essential, and each of them must respect the rules that concern it, whether on the sequence of characters, the presence of unauthorized characters, etc. From this crucial step of validating the format of the email, it is therefore possible to assert that a given address is incorrect. But of course, this is not enough, because when we want to know if an email address is valid, we also want to know if a real person is hiding behind it.
The validity of the existence of the mailbox
To test that an email is valid, it is necessary to check the existence of the corresponding mailbox. It is a test carried out by a server, able to connect to these mail servers and communicate with them in the same way that software sends a real email. But during this communication, the test will simply check if the email address actually exists, instead of actually sending an email to the recipient. Thus no email is sent but you will have the assurance that the email address is correct.