A wrapper for the NodeJS Dns.resolveMx method that checks the domain of an email address for valid/existence of MX records.
$ npm install legit
const legit = ;;
If an email addresses domain is legit then the object returned will include an
isValid key that will be set to
true as well as an
mxArray key with all the MX record information for the valid domain.
If the domain has no MX or cannot resolve any MX then it will return
Anything else is considered an error and you'll get it in the
For a valid email address, you'll get the following response object:
(The MIT License)
Copyright (c) 2015-2018 Martyn Davies, and contributors.