Server Accepts Email

Check if an SMTP server accepts emails to a given address.


npm install --save server-accepts-email


const serverAcceptsEmail = require('server-accepts-email')

console.log(await serverAcceptsEmail('[email protected]'))
//=> true

console.log(await serverAcceptsEmail('[email protected]'))
//=> false

console.log(await serverAcceptsEmail('[email protected]'))
//=> false


serverAcceptsEmail(email[, options])

  • email (string, required) - Email address to test
  • options (object, optional)
    • senderDomain (string, optional) - Domain to identify as (in HELO smtp command)
    • senderAddress (string, optional) - Email address to identify as (in MAIL FROM command)
  • returns Promise<boolean> - Wether or not email is accepted for the given address

Other libraries

There are some other libraries that do 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 Handles Greylisting 3 Connection Pooling 4
server-accepts-email āœ… āœ… āœ… āœ… āœ…
email-exists āœ… āŒ āŒ āŒ āŒ
email-existence āŒ āŒ āŒ āŒ āŒ
email-verify āŒ āŒ āœ… āŒ āŒ

1 None of the other libraries parsed the replies to support multiline replies but instead relied on every reply coming in a chunk, accepting all data and searching for substrings, or something similar.

2 Some of the other libraries rejects, or calls the callback, with something other than an Error instance.

3 This library detects Greylisting and sends another request after the timeout has passed.

4 This library reuses connections, and limits the number of simultaneous connections to any given host. This is more effecient, and the behaviour more closely matches that of proper SMTP clients, decreasing the chance of being blacklisted.

Server Accepts Email

Check if an SMTP server accepts emails to a given address

Server Accepts Email Info

ā­ Stars 31
šŸ”— Source Code
šŸ•’ Last Update 2 months ago
šŸ•’ Created 4 years ago
šŸž Open Issues 1
āž— Star-Issue Ratio 31
šŸ˜Ž Author LinusU