0.2.1 • Published 6 years ago
giga-email-exists v0.2.1
email-exists
FYI: THIS IS A FORK FROM THE ORIGINAL email-exists
Check whether an email address exists.
This module checks whether an email address exists by connecting to the mail server and pretending to send an email (but not actually sending it, of course).
For checking whether an email is syntactically valid, please use hapijs/isemail.
Installation
npm install giga-email-existsQuickstart
const emailExists = require('email-exists')
emailExists({ sender: 'darthvader@gmail.com',
recipient: 'lukeskywalker@gmail.com' })
.then(console.log)
// --> MAY_EXISTAPI
emailExists(options)
- requires an options
<Object>with the following properties:- sender
<String>: required; the sender's email address for theMAIL FROMcommand - recipient
<String>: required; the recipient's email address for theRCPT TOcommand - timeout
<Number>: default =3000; the timeout in milliseconds for the Telnet connection - debug
<Boolean>: default =false; whether to print debug messages to the console
- sender
- returns a
<Promise>which:- resolves with one of the following
<String>objects:INVALID_SYNTAX: Represents a553indicating that the mailbox name is not allowed due to invalid syntaxNOT_FOUND: Represents a550indicating that the mailbox is unavailable, cannot be found, or may not be accessedMAY_EXIST: To prevent clients from discovering all available addresses, servers may respond with false positives; therefore, this result is deliberately named "may exist", indicating that it is highly likely that the address actually exists, but that it cannot be confirmed (without actually sending a confirmation mail)
- rejects with an
<Error>object if either the DNS lookup or the Telnet connection fails
- resolves with one of the following
Maintainers
License
MIT
0.2.1
6 years ago