1

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 myname@gmail.com
  2. Entering a fake/random email address such as abcd@something.com

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. :)

Community
  • 1
  • 1
Snazzy Sanoj
  • 804
  • 1
  • 11
  • 28
  • 3
    Possible duplicate of [How to check if an email address exists without sending an email?](http://stackoverflow.com/questions/565504/how-to-check-if-an-email-address-exists-without-sending-an-email) – Philip Ramirez Jan 02 '16 at 09:23
  • 1
    http://superuser.com/a/224020 – Philip Ramirez Jan 02 '16 at 09:35
  • 1
    If there were a reliable way for anyone to check whether an email address exists, that would make the lives of spammers very easy indeed. Ask yourself instead *why* having a valid email at that point is so critical, and ways to address that specific need. – ardila Jan 02 '16 at 10:33

1 Answers1

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.

Māris Kiseļovs
  • 16,957
  • 5
  • 41
  • 48
  • Yes, so far I've been sending _confirmation URL_ type email, but the user's doesn't seem to like it that much, since every time they need to start a chat, they need to wait for mail, and verify, which is somewhat like inconvenience. – Snazzy Sanoj Jan 02 '16 at 09:37
  • 1
    @SnazzySanoj yes, it's an inconvenience but there isn't real way around it. Also, every user should do this only one time per each unique email address. – Māris Kiseļovs Jan 02 '16 at 09:45