Search code examples
emailsmtppingemail-validation

Validating to see if an email exists in its mailbox


I'm not looking for how to validate an email based on its syntax, but I'm looking to see if it is possible to find out if an email can be validated to see if it actually exists within its mail server.

I'm assuming that it goes something like this:

  1. User enters in his/her email address.
  2. The application checks it and validates the syntax.
  3. If valid, then the email itself is tokenized and the domain of the email @domain.com is fetched and pinged to see if that domain exists.
  4. If that domain exists then the SMTP or email service is somehow pinged to see if the account exists or not within its setup.

The last step is what I am lost with. Is there something like this that actually works?


Solution

  • No. That is, SMTP has commands for this (VRFY and more tangentially EXPN) but they are disabled by default because spammers abused them widely back in the 1990s.

    Also, on many modern networks, for reasons of scalability and security the public-facing mail server of a domain often doesn't even know if an address is valid or not, it just does spam and virus filtering, then relays to an internal mail server.

    I assume as part of your question you mean "without sending an email message", but even that is an imperfect method - if you get a bounce, you know it failed, but if not, you might have failed anyway.