Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check programmatically if an email is existing or not

Tags:

email

How to write a code to check an email is existing or not? For example [email protected], [email protected], or [email protected] all these emails do not exist in gmail, yahoo and lycos database.
enter image description here


See the screenshot. [email protected] is bad. That means it does not exist. how can i implement the same thing in my project?

javascript, jquery shell script, c or c++ are welcome. Without .net.

like image 839
Sreeni Puthiyillam Avatar asked Dec 27 '22 22:12

Sreeni Puthiyillam


1 Answers

In short: it is not possible. At most you can try to check if the domain in question have MX record and try to connect to its mail server. Even that won't guarantee it is in working condition though.

You absolutely can't check if a particular e-mail exists on it in some standartized way as there are many approaches to masquerade and aliasing that many server employ. Servers can and will report in SMTP exchange non-existent addresses as valid for many reasons in both VRFY and MAIL/RCPT. The only definite answer you can get is that e-mail is invalid if it is rejected by MAIL/RCPT, but being accepted is not definite proof of it being valid, as it can be rejected down the line of e-mail processing. Abusing MAIL/RCPT without actually sending anything can also lead to you being blocked.

If you want to verify user-supplied e-mail, your best bet is to send confirmation letter there.

You also should review if you really need confirmed working e-mail at all.

like image 173
Oleg V. Volkov Avatar answered Feb 07 '23 09:02

Oleg V. Volkov