Email VerifierAPI

API

API Reference

verifyEmail(email, options?): Promise<EmailVerificationReport>

The top-level orchestrator. Runs the offline checks immediately, then — unless offline is set — the network checks, and aggregates everything (including the score) into one report.

Parameters:

  • email (string): The address to verify
  • options? (VerifyEmailOptions): see below

VerifyEmailOptions:

OptionTypeDefaultDescription
offlinebooleanfalseSkip all network checks (overrides checkSmtp)
checkSmtpbooleantrueRun live SMTP verification
cacheCache<MxCheckResult>Shared cache for MX/SMTP lookups across a list
smtpSmtpVerificationOptionsSMTP probe options (timeout, catchAllProbes, …)
disposableDisposableEmailOptionsDisposable-list overrides
freeFreeEmailOptionsFree-list overrides
roleCustomPrefixesIterable<string>Additional role-account prefixes
typoTypoOptionsTypo-suggestion overrides
weightsPartial<ScoreWeights>Score weight overrides (see Scoring)

EmailVerificationReport

type VerificationState = "deliverable" | "risky" | "undeliverable" | "unknown";

interface EmailVerificationReport {
    email: string;
    state: VerificationState; // overall verdict
    reason: string; // human-readable explanation
    score: number; // composite 0–100

    syntaxValid: boolean;
    disposable: boolean;
    free: boolean;
    role: boolean;
    noReply: boolean;
    acceptAll: boolean; // catch-all domain
    mailboxFull: boolean;
    deferred: boolean; // greylisted / inconclusive
    secureEmailGateway: boolean;

    domain: DomainReport; // MX resolution
    smtp?: SmtpVerificationResult;
    name: NameResult; // parsed first/last/full + confidence
    character: CharacterResult;
    symbol: SymbolResult;
    tag: TagResult; // +sub-address detection
    provider?: MxProviderInfo; // classified mailbox/SEG
    didYouMean?: string; // typo suggestion
}

Standalone checks

Each is exported from the root and from its own subpath.

FunctionSubpathPurpose
validateSyntax(email)@visulima/email-verifier/checks/syntaxRFC-ish syntax validity
checkMxRecords(domain, opts?)@visulima/email-verifier/checks/mxMX (with A/AAAA fallback)
verifySmtp(email, opts?)@visulima/email-verifier/checks/smtpSMTP RCPT / catch-all / mailbox-full
isDisposableEmail(email)@visulima/email-verifier/checks/disposableDisposable domain
isFreeEmail(email)@visulima/email-verifier/checks/freeFree mailbox provider
isRoleAccount / isNoReply@visulima/email-verifier/checks/roleRole / no-reply mailbox
detectTag(email)@visulima/email-verifier/checks/tag+tag sub-addressing
analyzeCharacters(email)@visulima/email-verifier/checks/characterLocal-part character irregularities
analyzeSymbols(email)@visulima/email-verifier/checks/symbolUnicode / mixed-script analysis

Enrichment

FunctionSubpathPurpose
enrichProvider(records)@visulima/email-verifier/enrich/providerProvider / SEG from MX
classifyMx / classifyMxRecords / isSecureEmailGateway@visulima/email-verifier/enrich/providerRe-exported MX classification
suggestEmailTypo(email)@visulima/email-verifier/enrich/typoMisspelled-domain suggestion
suggestDomain / sift3Distance@visulima/email-verifier/enrich/typoLower-level typo helpers
parseName(email)@visulima/email-verifier/enrich/nameFirst / last / full name + confidence

Scoring

ExportPurpose
scoreReport(input, weights?)Compute { score, state, reason }
DEFAULT_WEIGHTSThe default scoring weights

See Scoring for the weight table and override examples.

Caching

InMemoryCache (implements the Cache interface) can be shared across calls so repeated domains reuse MX/SMTP work:

import { InMemoryCache, verifyEmail } from "@visulima/email-verifier";

const cache = new InMemoryCache();

await verifyEmail("a@example.com", { cache });
await verifyEmail("b@example.com", { cache }); // reuses example.com MX/SMTP
Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues