It is impossible to perform a definitive validation of an email address because many target SMTP servers accept messages even for addresses that do not exist, and maybe only then return a message to a sender stating that the email is not valid.
However what you can do is simulate sending a message to the given email address and see if the target SMTP server would accept the recipient.
For this you need to consult the DNS to obtain the MX record of the domain informed and so know which server or servers would receive the message for that domain. You can give 1 server, several or even none. In the latter case the server to be used must be the one of the record A of the domain.
Then connect to port 25 of each server. If one of them already refuses the recipient, you already know that it is invalid. If one of them says yes, you’ll know it’s valid. If no server accepts the connection or gives an error with 4XX code, it is not possible to know if it is valid, because it is a situation that can be temporary.
Implementing this algorithm properly is a bit of a hassle. However, I developed one myself PHP class for email validation that already implements all these steps and has been improved since 1999.
In addition the class even allows you to define a list of domains that you will never want to accept emails, such as those from temporary disposable emails.
Although it is not clear it seems very broad: there are several e-mail systems, each one with its particularities. If the author made himself he should know how to solve it.
– Gustavo Rodrigues
If you are using a third party system such as Gmail, you can only know if the email is valid or not. If you are using a system of your own lost said. Also, if it’s a login page just say something is wrong, for security.
– Gustavo Rodrigues
There are still other implications, such as: if the case is a registration form, say that the email is already being used; if you are using Google Apps, or similar, use the Apis. This still varies from the language used, commonly we work with PHP but you can use another: I find it a little broad.
– Gustavo Rodrigues
As far as I know, bfavaretto’s answer is the correct one. This post has some interesting things (How to check if an email address exists without sending an email?), but in the end it all seems quite experimental.
– brasofilo
Impossible to validate is not, but it takes work and you need to open the door of Telnet! See explanation in the article: > How to test if an email account is valid/exists without sending an email,
– user28777