How to use Mailgun to verify email addresses and reduce bounce rates

If you send email—whether it’s newsletters, product updates, or receipts—you know that bounces are more than just a nuisance. Too many, and your sender reputation tanks. The fix? Stop sending to bad addresses in the first place. This guide is for anyone sick of wasting time (and money) emailing people who’ll never see your message. We’ll walk through how to use Mailgun to check emails before you send, cut your bounce rate, and keep your list healthy.

Let’s get right to it.


Why Bother Verifying Emails?

Here’s the deal: not every email you collect is good. Typos happen. People use fake addresses to get freebies. Some emails look real but will never accept mail. If you just blast your whole list, you’re asking for trouble:

  • High bounce rates: Too many bounces, and inboxes start to think you’re a spammer.
  • Low engagement: Dead emails mean fewer opens and clicks, which can hurt deliverability.
  • Wasted money: Most email platforms charge by the number of emails sent, not delivered.

Verifying emails before you send is like checking if a phone number works before calling. It’s basic hygiene.


How Email Verification Works

Before diving into the how-to, let’s clear up what verification actually does.

When you verify an email, you’re checking:

  • Syntax: Is it a valid email format?
  • Domain: Does the domain (like gmail.com) exist and accept mail?
  • Mailbox: Does the specific address (like bob@gmail.com) actually exist? This is the tough part—some providers (looking at you, Gmail) don’t make this easy.

Mailgun’s verification API tries all three. It’s not magic and it won’t catch 100% of issues (no service does), but it’s good enough to weed out most junk.


Step 1: Set Up a Mailgun Account

If you don’t already have one, you’ll need a Mailgun account. The free tier is enough for basic testing, but you’ll burn through credits quickly if you have a big list.

  • Sign up at Mailgun’s site.
  • Once you’re in, go to the dashboard.
  • Find your API key (you’ll need it for later).

Pro tip: Don’t share your API key. It’s like a house key for your account.


Step 2: Decide When to Verify

There are two main ways to use email verification:

  1. On signup/form submission: Stop bad emails from getting into your database.
  2. In bulk, before a campaign: Clean your existing list in one go.

If you can, do both. Stopping junk at the door is always easier than cleaning up later.


Step 3: Use Mailgun’s Email Validation API

Option 1: Real-Time (Single Email Check)

Great for signups, contact forms, and anywhere users type their email.

How it works: Your app sends the email to Mailgun’s API. Mailgun replies with a verdict: is this email probably good, probably bad, or somewhere in between?

Sample request (using curl): bash curl -s --user 'api:YOUR_API_KEY' \ "https://api.mailgun.net/v4/address/validate?address=test@example.com"

Replace YOUR_API_KEY with your real key.

What you get back: json { "address": "test@example.com", "is_valid": true, "mailbox_verification": "true", "reason": "", "risk": "low", "did_you_mean": null }

  • is_valid: True/False. If false, don’t bother emailing.
  • mailbox_verification: Sometimes true/false, sometimes “unknown.” If unknown, play it safe and don’t trust it.
  • risk: “High” means more likely to bounce.

What actually works: - Catching obvious typos and dead domains. - Suggesting corrections (like “did you mean gmail.com?”).

What doesn’t: - Guaranteeing that Gmail, Yahoo, or corporate inboxes exist; privacy settings can block the check.

Option 2: Bulk Verification

If you already have a list, you can send it to Mailgun in bulk.

  • Go to Mailgun’s dashboard > Email Verification > Bulk Verification.
  • Upload your CSV.
  • Get a report back with “deliverable,” “undeliverable,” and “do not send” verdicts.

What works: Fast and easy for big lists.

What doesn’t: You’ll pay per address. If you’re cleaning a million-address list, costs add up.


Step 4: Handle the Results (Don’t Just Collect Them)

Verification’s only useful if you do something with the answers. Here’s what you should actually do:

  • On forms: Block or warn users if their email is “undeliverable” or high risk.
  • In bulk: Remove or suppress undeliverable/high-risk emails before importing into your email tool.
  • “Do not send” verdict: Just don’t. It’s not worth the risk.

Don’t obsess about “unknown” results. Some inboxes just can’t be verified. If a lot of real users have “unknown” status (like corporate emails), consider letting them through, but keep an eye on their bounce rates.


Step 5: Automate Ongoing Verification

One-time cleanup is good, but new bad emails sneak in all the time. Set up recurring verification:

  • Integrate with sign-up forms: Run verification every time a new email is collected.
  • Schedule regular bulk checks: Once a quarter (or more often if you send a lot), re-run your list to catch addresses that have gone stale.

Pro tip: If you use tools like Zapier or Make, you can automate Mailgun checks without writing code.


Honest Take: The Limits of Email Verification

Let’s be real: no service can guarantee zero bounces. Here’s what to keep in mind:

  • Mailbox verification is hit-or-miss: Gmail, Outlook, and many others block real-time mailbox checks to prevent spam. “Unknown” is common, especially for these.
  • Disposable emails slip through: Temporary inboxes (like mailinator.com) usually pass technical checks. Consider blocking known disposable domains separately.
  • You still need engagement: Even “deliverable” emails might never open your messages. List quality is about more than just bounces.
  • Costs can add up: Mailgun charges per verification. Don’t run your whole list every week unless you really need to.

Skip services claiming 100% accuracy or “AI-powered” magic. If anyone promises you’ll never bounce again, they’re selling snake oil.


What to Ignore

  • Overly aggressive filtering: Don't block every “unknown” or “risky” email unless you love false positives.
  • Fancy front-end validation scripts: They catch typos, sure, but they don’t check if an inbox actually exists.
  • Manual reviews: Trying to hand-check addresses at scale isn’t worth your time.

Pro Tips for Fewer Bounces

  • Double opt-in: Ask users to confirm their email by clicking a link. It’s old-school, but it works.
  • Clean your list before big campaigns: Nothing tanks deliverability like a blast to a dirty list.
  • Watch your sender reputation: Use post-send bounce reports to spot trends and act before things get ugly.

Keep It Simple

Don’t overthink it. Start by verifying new emails as you collect them. Clean your old list once. Check in every so often. That’s it. There’s no secret sauce—just basic hygiene and a little automation. Iterate as you go. Focus on the stuff that actually moves the needle, and ignore the rest.

You’ll sleep better knowing you’re not blasting ghosts, and your messages are reaching real people.