Article

Best Golang Email Validation Packages in 2026 (Compared)

By Unlimited Verifier Team ·

Diagram of a Golang email validation pipeline showing net/mail syntax checks, net.LookupMX domain checks, and batch mailbox verification.

Summary

The best Go email validation setup layers three checks: net/mail for syntax, net.LookupMX for domain checks, and a hosted verifier like Unlimited Verifier for mailbox and catch-all decisions in batch. Open-source packages prove format and DNS well but cannot reliably confirm whether a mailbox exists. This guide compares seven options and walks through a working pipeline.

The best Go email validation setup layers three checks: the standard library's net/mail for syntax, net.LookupMX for domain checks, and Unlimited Verifier for mailbox and catch-all decisions in batch. Open-source Go packages can prove format and DNS well, but they can't reliably settle whether a mailbox exists, especially on catch-all domains.

Unlimited Verifier is a hosted service rather than a Go library, so this guide assumes you call its REST API with net/http or upload CSV files. It's written for Go developers building signup flows, and for marketers, list owners, agencies and SaaS teams running Go services that need to clean large databases. It compares seven options, explains what each layer can and cannot prove, and walks through a working pipeline. For the concept behind inline checks, start with real-time email validation.

Quick answer

Which Go email validation packages are best, and how do they compare?

No single Go package covers every layer, so the right choice depends on which decision you're making. Inline checks belong in the request path; mailbox decisions belong in batch.

Quick picks by situation

Tool Starting price Free tier Catch-all handling Best for
Unlimited Verifier $0 (Free); $29/mo or $25/mo billed annually (Pro) Yes: 25 lists/mo of up to 150 emails each, 750 deep verifications; no API access Detects catch-alls and routes them to Risky Batch mailbox and catch-all decisions, with weekly re-checks via API
net/mail Free (standard library) Not applicable None Syntax checks at input
go-playground/validator v10 Free (open source) Not applicable None Struct and request validation
badoux/checkmail Free (open source) Not applicable None built in Small internal tools
AfterShip email-verifier Free (open source; check license) Not applicable Varies; check the repository Self-hosted multi-check
DIY net/smtp probe Your own infrastructure costs Not applicable Not confirmable by RCPT TO alone Teams with mail operations skills
Hosted APIs (ZeroBounce, NeverBounce, Kickbox, others) Varies Varies Varies by vendor Managed service with a REST client

Bottom line: pick the combination by layer, because no single package answers every question.

How did we compare these options, and what can't this comparison tell you?

We compared each option on five criteria, using public documentation and package descriptions:

  1. Layers covered: syntax, DNS/MX, SMTP mailbox, catch-all, and disposable or role-based detection.
  2. Where it runs: inline in the signup path, or in batch against a file or API.
  3. Operational burden: port 25 access, IP reputation, rate limits and the code you must maintain.
  4. Output actionability: a boolean, a structured result, or send/segment/suppress buckets.
  5. Maintenance visibility: license, recent commit activity and how clearly the project documents its behavior.

Limitations. We did not run accuracy benchmarks or measure any option against a real mailing list. Accuracy figures are vendors' own claims. Open-source projects change, so check the current repository before adopting one. Hosted pricing changes often, so we've marked it "varies" wherever we weren't certain.

Bottom line: use this comparison to decide which layers you need, then confirm current details in each project's documentation.

Which Go email validation packages are worth using?

These seven options are ranked by fit for production validation, not by popularity. Unlimited Verifier leads for batch mailbox decisions.

1. Unlimited Verifier (best overall for bulk lists)

Unlimited Verifier is a bulk verification service. You upload a CSV or Excel file of up to 10MB, the email column is detected automatically, and every address goes through syntax, domain, MX and SMTP mailbox checks. It flags disposable and role-based addresses, detects catch-all domains, and sorts each address into Valid, Risky or Invalid. Results export as CSV, Excel or JSON.

For Go teams, the important part is the REST API with API keys, which accepts single-email checks and bulk batches of up to 10,000 emails per request on Pro. Your service sends the batch with net/http and stores the returned statuses. This is the core of email verification API and automation for Go. The engine is open source on GitHub, so you can read how each check is implemented, which helps when you have to explain a decision to a client or auditor.

Key features

Pros

Cons

Pricing: Free is $0 and includes 25 lists a month of up to 150 emails each, plus 750 deep verifications, with no API access. Pro is $29 a month, or $25 a month billed annually. It adds unlimited lists of up to 25,000 emails each, 25,000 deep verifications a month, API access for up to 100,000 emails a month, and 30-day result retention.

Worked example (illustrative). Assume a list of 60,000 subscribers that adds about 700 signups a week.

Best for: Go teams that need mailbox and catch-all decisions on large lists without per-check billing.

Where it falls short: signup requests that need an answer within the same round trip. Keep those on local checks and send mailbox decisions to batch.

Tip: run your Go precheck first, so the batch allowance covers only addresses that already pass syntax and MX checks.

2. net/mail (Go standard library)

mail.ParseAddress parses a single RFC 5322 address into a value with separate name and address fields. It needs no dependency and makes no network call, so it's the cheapest check you can run on every input. The package documentation is short and worth reading once, because its behavior is more permissive than many developers expect.

The trap is display names. Jane <jane@example.com> parses successfully, so a naive "is it valid?" check lets a header-style string through a form field. It also accepts some forms that real mail providers refuse, which is why net/mail works as a first gate, not a verdict.

Key features

Pros

Cons

Best for: normalizing and rejecting malformed input at the edge of your service.

Where it falls short: any question about deliverability.

Tip: compare the returned Address with your trimmed input and reject any mismatch. Lowercase only the domain. DNS names are case-insensitive, but RFC 5321 allows the local part to be case-sensitive, so store it as submitted.

3. go-playground/validator v10

go-playground/validator is a struct-tag validator commonly used in Go web APIs. Adding validate:"required,email" to a field applies its email rule when you call validate.Struct. It fits naturally if your handlers already bind request bodies to structs.

The email rule judges shape, not existence. It never asks DNS or a mail server anything. Pattern-based rules tend to disagree on unusual but legal addresses, so test the rule against your own signup data before trusting its rejections.

The useful extension is custom validation. The library lets you register your own tag, so an MX check can run inside the same struct validation and return through the same error path.

Key features

Pros

Cons

Best for: request validation in APIs and forms, combined with an MX check.

Where it falls short: lists where the question is whether mail will be delivered.

Tip: keep the email tag for shape, add a custom mx tag, and log rejected inputs for a few weeks to see which rules reject real customers.

4. badoux/checkmail

badoux/checkmail is a small library with separate functions for format, host (MX) and an SMTP user check. Because each layer is its own function, you can use only what you need, and the surface is small enough to read in one sitting.

The SMTP step is where it breaks down in production. It connects on port 25, and many cloud providers restrict outbound port 25 by default, so the check can fail from a typical cloud host for reasons unrelated to the address. Catch-all servers accept any recipient, so a positive answer doesn't prove a mailbox exists. The library also doesn't flag catch-all or disposable domains on its own.

Key features

Pros

Cons

Best for: internal tools and prototypes where format and MX checks are enough.

Where it falls short: list cleaning, where catch-all and risky-address handling drive decisions.

Tip: run the SMTP step only from a host you've confirmed can reach port 25. Treat timeouts and temporary failures as unknown, not invalid.

5. AfterShip email-verifier

AfterShip's email-verifier is an open-source library that bundles several checks behind one call. According to its README at the time of writing, it covers syntax, MX, SMTP mailbox, disposable domains, role-based accounts and free email providers, and returns a structured result with a field per check. Confirm the current feature list in the repository before depending on it.

Per-field results are more useful than pass/fail, because each flag maps to a different decision. But the limits are the same as any probe. A positive SMTP answer on a catch-all domain doesn't prove a mailbox, and many probes from one IP create reputation and throttling problems that you now own.

Key features

Pros

Cons

Best for: Go services that want richer flags without a hosted vendor.

Where it falls short: teams that want someone else to own catch-all analysis and sending reputation.

Tip: map each result field to an action before you write code. For example: disposable means block at signup, catch-all means Risky in batch, and an SMTP timeout means unknown and retry.

6. DIY probe with net/smtp and net.LookupMX

You can build a probe from the standard library. Look up MX records, dial a host on port 25, and speak SMTP up to RCPT TO. net.LookupMX returns records sorted by preference, so mxs[0] is the first host to try. The Host field ends in a dot, so trim it before you log or compare.

The reply codes carry the meaning. Under RFC 5321, a 2yz reply to RCPT TO (usually 250 or 251) means the server accepts the recipient. A 5yz reply is a permanent rejection, and a 4yz reply is temporary: the right answer is "try again later," not "invalid." The same RFC says that when a domain has no MX record, mail falls back to the domain's A record, so a strict probe must check that before rejecting. The probe must stop before DATA, because anything after that point is sending mail.

Key features

Pros

Cons

Best for: teams with mail operations experience who need a probe inside their own network.

Where it falls short: most product teams, who would rather not run a sending-adjacent service.

Tip: treat every 4yz reply as unknown, retry later, and cap concurrent connections per destination domain. Keep a log of replies per domain so you can spot throttling. How to do an SMTP email check covers the reply handling in more depth.

7. Hosted verification APIs (ZeroBounce, NeverBounce, Kickbox and others)

Several commercial verifiers expose REST APIs that a Go service can call with net/http. Their differences lie mainly in the output model, and vendors describe those in their own documentation. ZeroBounce describes granular statuses, including a dedicated catch-all status. Kickbox describes a Sendex quality score alongside its result categories. NeverBounce describes integrations that sync lists with email platforms. Check each vendor's current documentation before building on any of these descriptions.

The trade-off is cost structure. Many hosted verifiers charge per check or per credit, so weekly re-verification adds spend every cycle. Compare per-check and flat models in email verification pricing and price your real annual volume, including re-checks.

Key features

Pros

Cons

Best for: teams that want a managed service and accept per-check costs.

Where it falls short: flat-cost bulk cleaning at high frequency.

Tip: write down each vendor's categories and map them to send, segment and suppress before writing the Go code that acts on them.

Bottom line: the seven options split into a clear pattern. Libraries cover syntax and shape, probes cover SMTP with real operational cost, and Unlimited Verifier covers batch mailbox and catch-all decisions without running mail infrastructure yourself.

How do you build a Go validation pipeline with Unlimited Verifier?

Run syntax and MX checks inline in Go, send the list in batches to Unlimited Verifier for mailbox and catch-all decisions, and store each outcome with a timestamp. The build is one-time work, followed by a short weekly job.

  1. Assign each check to the layer that can prove it. Syntax and MX run inline. Mailbox and catch-all decisions run in batch. A signup should never wait on an SMTP probe.

  2. Add the inline precheck to your signup handler. This function uses net/mail for syntax and net.LookupMX for domain checks:

package main

import (
	"errors"
	"fmt"
	"net"
	"net/mail"
	"strings"
)

type Verdict string

const (
	Pass    Verdict = "pass"    // continue to batch verification
	Reject  Verdict = "reject"  // definitively bad input
	Unknown Verdict = "unknown" // temporary DNS failure: retry, don't reject
)

// precheck runs inline checks only: syntax, bare-address form, and domain MX/A.
func precheck(raw string) (string, Verdict, error) {
	in := strings.TrimSpace(raw)

	addr, err := mail.ParseAddress(in)
	if err != nil {
		return "", Reject, fmt.Errorf("syntax: %w", err)
	}
	if addr.Address != in { // rejects "Name <a@b.com>" forms
		return "", Reject, errors.New("display-name form not allowed")
	}

	at := strings.LastIndex(in, "@")
	local, domain := in[:at], strings.ToLower(in[at+1:])
	normalized := local + "@" + domain // lowercase domain only; local part kept as submitted

	mxs, err := net.LookupMX(domain)
	if err != nil {
		var dnsErr *net.DNSError
		if errors.As(err, &dnsErr) && dnsErr.IsNotFound {
			// No MX: RFC 5321 falls back to the A record, so check that before rejecting.
			if _, aErr := net.LookupHost(domain); aErr == nil {
				return normalized, Pass, nil
			}
			return "", Reject, fmt.Errorf("%s has no MX or A records", domain)
		}
		return "", Unknown, fmt.Errorf("mx lookup for %s: %w", domain, err)
	}
	if len(mxs) == 1 && mxs[0].Host == "." {
		return "", Reject, fmt.Errorf("%s publishes a null MX", domain)
	}
	return normalized, Pass, nil
}

On Reject, return a validation error to the user. On Unknown, accept the signup, mark it pending and queue it for batch verification. Don't let a temporary resolver failure cost you a real subscriber.

  1. Test the precheck on real rows. Run it against about 50 addresses from your current database and read every rejection before you tighten or loosen a rule. Include a few display-name entries and a few typo'd domains.

  2. Export the list as CSV with the email column. Match results back to users by email address, not row order, and keep user IDs in your own database.

  3. Split the file to your plan's caps. Free handles up to 150 emails per list. Pro handles up to 25,000 per list, within a 10MB file.

  4. Upload and verify each list. The email column is detected automatically.

  5. Sort the three buckets. Valid is sendable, Invalid is suppressed, and Risky (catch-alls, disposable and role-based addresses) is segmented. For how catch-alls are handled, read catch-all email verification. Spend deep verifications on Risky only.

  6. Store every result with a status and timestamp. Add verification_status, verified_at and verification_source columns, so stale results can be rerun. Free results are kept 24 hours and Pro results 30 days, so your copy is the long-term record. Re-import Valid as active, Invalid to suppression, and Risky to a segment.

  7. Automate with the API on Pro. Generate a key on the email verification API page, follow the request format in the API documentation, and send weekly signups in batches of up to 10,000. API access isn't included on Free, so automation starts on Pro.

  8. Check the arithmetic before you set a schedule. Using the worked example above, 60,000 subscribers plus 700 weekly signups needs about 62,800 API emails a month if you run the full list monthly, or about 22,800 a month with a quarterly full pass.

  9. Schedule two jobs. A weekly job verifies new signups, and a quarterly job re-verifies the full list. Email list maintenance best practices covers the sunset policy that should run alongside them.

Bottom line: inline syntax and MX checks in Go, batch mailbox decisions through Unlimited Verifier, and stored results with timestamps.

Which option should you choose for your situation?

Match the tool to the layer you need and where that layer runs.

Situation Choose Why
Malformed input at a Go API endpoint net/mail plus validator Free, fast, no network call
MX check at signup net/mail plus net.LookupMX Confirms the domain can receive mail
Cleaning a large list with catch-all handling Unlimited Verifier Batch Valid/Risky/Invalid with a REST API on Pro
Self-hosted, several signals per address AfterShip email-verifier Structured multi-check result
Managed service with richer categories Hosted API Vendor-specific statuses and scores
Mail operations skills and a reason to self-host DIY net/smtp probe Full control, real operational cost
Browser hints before the request is sent Front-end checks Fast feedback only, never the final check

If you're building the signup side, read how to add real-time email verification to signup forms and client-side vs server-side email validation to decide where each check belongs. For browser-side hints, see how to validate email in JavaScript, email validation in React Hook Form or how to validate email in TypeScript. Teams on other backends can compare best Ruby gems for email validation, how to validate an email address in C# or the Laravel DNS validation rule. If a provider throttles your checks, email validation API rate limits explained covers planning.

For ecommerce and SaaS signup flows the layering is the same, which is why email verification for ecommerce and SaaS usually means a combination of tools. If your bad addresses come from forms that accept anything, email list growth strategies covers how to attract signups worth verifying. For a wider market view, see our roundup of best email verification tools.

Bottom line: use Go libraries for what they can prove, format and DNS, and a batch verifier for the mailbox question they can't answer.

What mistakes do Go teams make with email validation?

Inbox providers also watch complaints. Google's sender guidelines point bulk senders to keeping the spam rate in Postmaster Tools below 0.10%, and warn against reaching 0.30%. Older summaries quote 0.3% as the line, so treat 0.10% as your working target. Bounces aren't spam complaints, but a dirty list tends to produce both.

Bottom line: most Go validation failures come from reading one layer's answer as if it proved a different layer's question.

What should your Go stack actually do?

Use net/mail and an MX lookup inline, keep the signup path fast, and send the full list plus weekly new signups through Unlimited Verifier, which sorts results into Valid, Risky and Invalid and offers a REST API on Pro. Use go-playground/validator for shape rules in request structs. Treat AfterShip's library or a DIY probe as options only if you can run SMTP checks reliably, and consider a hosted API when per-check pricing fits your volume.

If you're starting today, create a free account, verify one list to see your bucket split, and move to Pro when you need the API or lists beyond 150 emails. For a quick check of a single address first, use the free email checker.

Bottom line: let each Go package do the job it can prove, and use a batch verifier for the mailbox question no library can answer on its own.

Three-layer Go validation pipeline

  1. Syntax (inline): parse with net/mail.ParseAddress; reject on error.
  2. Domain (inline, cached): net.LookupMX on the domain; cache results per domain for a short TTL.
  3. Mailbox (batch): send the list to a verifier API or CSV upload; sort results into Valid, Risky or Invalid.
  4. Never block signup on step 3; use Risky results for follow-up or double opt-in.

Frequently asked questions

What is the best Go package for email validation?

For syntax, the standard library's net/mail is the best starting point because it has no dependencies. For mailbox decisions, a hosted verifier such as Unlimited Verifier handles catch-all detection in batch, which open-source packages cannot reliably do on their own.

Can net/mail validate that an email address exists?

No. net/mail only checks that an address is correctly formatted under RFC 5322 rules. It cannot tell whether the mailbox exists or accepts mail, so pair it with DNS and mailbox checks for stronger results.

How do I check if a domain can receive email in Go?

Call net.LookupMX with the domain part of the address. If it returns records, the domain has mail exchangers. If it returns an error or no records, the domain likely cannot receive mail, though some domains fall back to A records, so treat the result as a signal.

Why shouldn't I block signups on an SMTP probe?

Remote SMTP checks depend on the receiving server, which may greylist, rate-limit or accept every address on catch-all domains. A failed or slow probe can wrongly reject real users, so use it in batch and treat results as risk scores.

What is catch-all detection?

A catch-all domain accepts mail for any address, so a mailbox-level check cannot confirm a specific person exists. Good verifiers label these as Risky rather than Valid, which lets you decide how to handle them.

Is go-playground/validator good for email checks?

Yes for shape checks. Its email tag in v10 validates format inside request structs, which is useful for API input. It does not check DNS or mailbox existence.

Does Unlimited Verifier have a Go SDK?

Unlimited Verifier is a hosted service, so Go code calls its REST API with net/http or uploads CSV files. Check the official documentation for current endpoints and plan access.

Should I re-verify email lists over time?

Yes. Addresses decay as people change jobs or close accounts. Scheduled re-checks through an API, such as weekly runs, keep lists current and reduce bounce risk.

Cut Bounces and Protect Your Sender Reputation With Unlimited Email Verification

Every invalid address you send to hurts your sender reputation and your inbox placement. Verifying your list before each send means fewer bounces, healthier deliverability, and a predictable cost. With Unlimited Verifier, standard verification is unlimited on every plan, with no per-email fees.

Unlimited Verifier checks syntax, domain, MX records and the SMTP mailbox. It also detects catch-all domains and flags disposable and role-based addresses. Export a CSV from your email platform or CRM, upload and verify the list, then re-import the clean results. You can also automate checks with the email verification API.

Free Pro
Price $0 $29/month ($25/month billed annually)
Lists 25 a month, up to 150 emails each Unlimited, up to 25,000 emails each
Deep verifications 750 a month 25,000 a month
API access No Yes (100,000 emails a month)
Result retention 24 hours 30 days

Why teams choose Unlimited Verifier

Unlimited Verifier states 99.5% accuracy for deep verification.

Create a free account and verify your next list before you hit send.

Want to test a single address first? Try the free email checker.