Package Exports
- server-accepts-email
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (server-accepts-email) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Server Accepts Email
Check if an SMTP server accepts emails to a given address.
Installation
npm install --save server-accepts-emailUsage
const serverAcceptsEmail = require('server-accepts-email')
console.log(await serverAcceptsEmail('linus@folkdatorn.se'))
//=> true
console.log(await serverAcceptsEmail('6bJ4zsZHOE@folkdatorn.se'))
//=> false
console.log(await serverAcceptsEmail('linus@gp5uzpn2q7.se'))
//=> falseAPI
serverAcceptsEmail(email[, options]) => Promise<boolean>
email(string, required) - Email address to testoptions(object, optional)senderDomain(string, optional) - Domain to identify as (inHELOsmtp command)senderAddress(string, optional) - Email address to identify as (inMAIL FROMcommand)
Other libraries
There are some other libraries that does the same thing, but I found them to have some flaws which made me write this one.
| Promise API | Follows RFC5321 1 | Proper Errors 2 | |
|---|---|---|---|
server-accepts-email |
✅ | ✅ | ✅ |
email-exists |
✅ | ❌ | ❌ |
email-existence |
❌ | ❌ | ❌ |
email-verify |
❌ | ❌ | ✅ |
1 None of the other libraies parsed the replies to support multiline replies, but instead relied on every reply comming in a chunk, accepting all data and searching for substrings, or something similar.
2 Some of the other libraries rejects, or calls callback, with something other than an Error instance.