Check whether a given email address is disposable address
DisposableEmail.isDisposableEmail(hello@gmail.com) -> false
DisposableEmail.isDisposableEmail(hello@mailsac.com) -> true
To stop checking DNS
DisposableEmail.isDisposableEmail(hello@gmail.com, false) -> false
Use different DNS resolver
DisposableEmail.isDisposableEmail(hello@gmail.com, true, DNS_RESOLVER_TYPE.CLOUD_FLARE) -> false
DisposableEmail.isDisposableEmail(hello@gmail.com, true, DNS_RESOLVER_TYPE.GOOGLE) -> false
- By default, we are checking the given email against the local copy of disposable email domains. If it is
false
, the checking DNS- We check DNS MX (mail) record for the domain. If MX record present, then return
true
- We check DNS MX (mail) record for the domain. If MX record present, then return
- Otherwise, returning
true
(disposable email domain)
This lib has a list of disposable email domains inside resources.
The following method will download latest disposable email list from https://disposable.github.io/disposable-email-domains/domains.txt
and use it
DisposableEmail.refreshDisposableDomains()
- We are using BloomFilter a space-efficient probabilistic data structure
- We are using DNS over HTTPS to verify the MX Records
- CloudFlare and Google DNS resolvers are support