I'm trying to make sure a user types in a valid email that also actually exists, not just valid in format. There is a npm package called email-existence that should do this but every email returns a false so that is not reliable. If there is a javascript/Node.js Package that does this job, it would be great, but is there also a way I can do this myself? Like ways to create a small module for this functionality?
3 Answers
The only guaranteed way to find out whether an e-mail address exists is to send an e-mail to it - this is why verification e-mails exist.
There's a similar discussion here with a few answers detailing possible ways to try and determine if an address exists on a server, but none are guaranteed to work on every server.
Alternatively, you could use a paid service such as Kickbox.io (they also have a 100/day free quota), which claims to verify that an e-mail address exists as well as determine the "quality" (based on deliverability and other metrics) of an address. Kickbox has a node.js package.
-
In SMTP the process of sending an e-mail is preceded by `MAIL FROM` and `RCPT TO` commands. The SMTP server will, for instance, respond with `550-5.1.1` if the mailbox does not exist. Here is a screenshot that I have taken of this functionality on Gmail's SMTP: https://i.ibb.co/hKdTWZZ/image.png – undefined Oct 19 '22 at 16:47
Installation To install via npm:
npm install email-existence
Usage
Check existence:
emailExistence.check('email@domain.com', function(err,res){
console.log('res: '+res);
});

- 1,896
- 18
- 20
-
4I found this one not validating yahoo, even though the email id doesn't exits, it returns true – Ankit Sep 02 '16 at 07:39
-
2This package doesn't seem to work too well. Validates some gmail addresses. but most corporate emails it can't seem to validate. – b.lyte May 17 '19 at 19:13
-
Prints true of false for any mailbox independent if it really exists on the particular server – Роман Коптев Jun 17 '23 at 17:08
I think "email-verifier" package will come handy in this case
Source : https://medium.com/whois-api/how-to-verify-an-email-address-using-node-js-449330a47a7e

- 1,149
- 1
- 6
- 7