Check if an email exists or your email domain

1

I need to check in Java whether an email or if your domain exists. I do not mean to treat the validity of the email, using for example regular expression, but rather really check if there is an associated account. I have seen some forums on the web but many outdated ones from 2014 back, how can I do that today.

Example: [email protected]

I want to be able to check for the complete email [email protected] , and / or the @gmail.com domain, whichever is more feasible and possible to implement.

It would look something like that site does.

    
asked by anonymous 12.01.2018 / 13:42

2 answers

6

Since not every email API supports checking for the existence of a given email, it is likely that there is no way to check this programmatically. Some blogs suggest using telnet with the supposed email and verify that you receive a 550 reply. does not guarantee that the user has access to the email, besides being quite complex to do programatically. As stated in another answer to this question in SO , you can send VRFY requests, which is not implemented on every server, or a RCPT request, which can be silently discarded and does not guarantee validity every time.

The most common implementation is 2-step verification of email, that is, you send an email with a confirmation link (which is accompanied by a verification token), and the user clicks the link to confirm that the email is both valid and his.

    
12.01.2018 / 14:25
3

For me, check if an email exists only to send spam . So I do not care how to solve this question. I do not even want to know if you have the mailing address or the domain.

Verify that someone who is registering in a place and has a valid email (in every sense), even if it is his, has only two solutions.

The first one has already been quoted the other answer, so I've already voted for it, have to send a message to the user where it confirms that it received. It is flawed, but it has not much to do. It actually works in almost every case if UX is good.

The other is to do it right, that is, do not ask the person to register, ask her to authenticate herself. Use his data requiring less effort than registering, and you know that not only does email exist, but it is from who is signing up, with no other interaction than immediate access to the authorization page of the chosen authenticator. >

This may be Google , Facebook , Microsoft a>, and many others, even niche ones such as this site .

Search for OAuth ( international provider list ), Single Sign On , User-Managed Access , OpenID , OATH , just to stay in some.

No one is a panacea. Use a fallback if the user can not use such a provider, then confirm by sending a token to authenticate the first solution.

If none of this solves, sit down and cry:)

    
12.01.2018 / 16:00