Checking existence of email address

I’m developing a web application with Chat Support, and so far, I’ve been using JQuery validation to check whether the input text is a well formatted email address.

But that doesn’t seem to fulfill its purpose.

For example:

  1. Entering a working and legitimate email address such as
    [email protected]
  2. Entering a fake/random email address such as [email protected]

Both are accepted into the field as valid.

So is there any way to detect whether the specified email address exists or not in real-life, by using PHP (or any other) without sending the user, a click-to-confirm email?

I’ve tried the SMTP method discussed in the other question, but unfortunately, the server returned error for all Email addresses, even legitimate ones. I think they have prevented enumeration for security purposes.

Any help would be greatly appreciated. 🙂

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

No, it’s not possible to reliably check if email address actually exists withotu sending an actual email. All you can do by yourself is to check syntax of email address and check of domain name exists.

To check email address syntax:

filter_var($email, FILTER_VALIDATE_EMAIL)

To check A and MX records:

checkdnsrr($domain,"MX") || checkdnsrr($domain,"A")

Next step is to send actual email with confirmation URL or confirmation code.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x