Skip to content

// transactional email

Via API

MailerSend email verification with pingutil

When a MailerSend email hard bounces, the user who mistyped their address quietly stops getting your mail, and you only see it in the activity log. A pingutil check before POST /v1/email catches those addresses while the user is still on the form, and the activity.hard_bounced webhook tells you about the ones that go bad later.

Where it connects: Your code before POST /v1/email, plus MailerSend webhooks (activity.hard_bounced)

What goes wrong without it

  • Our MailerSend dashboard shows hard bounces from accounts that were created minutes earlier.
  • Users sign up with typo domains and then complain they never got the verification link.
  • We want to know who is bouncing inside our own app, not just in the MailerSend activity log.

What you can do with MailerSend and pingutil

  • Verify on the signup form

    Call /v1/verify when the form is submitted and return did_you_mean, so the verification link goes to an inbox that exists.

  • Block disposable addresses on free-trial signups

    Disposable domains return status invalid with reason disposable_domain. Refuse the trial before MailerSend sends anything.

  • Flag users from activity.hard_bounced

    Subscribe a webhook to activity.hard_bounced, check the Signature header, and flag the user whose address is in data.recipient.

Set it up

  1. 1

    Store PINGUTIL_KEY next to your MailerSend API token.

  2. 2

    Call pingutil /v1/verify before POST https://api.mailersend.com/v1/email.

  3. 3

    Return did_you_mean to the user for invalid addresses; send for the rest.

  4. 4

    Create a MailerSend webhook for activity.hard_bounced and verify the Signature header (HMAC-SHA256 of the raw body with your signing secret).

  5. 5

    Flag the user and verify any replacement address with pingutil.

Node: verify, then send with the MailerSend email API
type Verification = { status: string; reason: string; did_you_mean: string | null };

async function verify(email: string): Promise<Verification | null> {
  try {
    const res = await fetch('https://pingutil.com/v1/verify', {
      method: 'POST',
      headers: { authorization: 'Bearer ' + process.env.PINGUTIL_KEY, 'content-type': 'application/json' },
      body: JSON.stringify({ email }),
      signal: AbortSignal.timeout(8000),
    });
    return res.ok ? ((await res.json()) as Verification) : null;
  } catch {
    return null; // fail open
  }
}

export async function sendVerificationLink(email: string, link: string) {
  const v = await verify(email);
  if (v?.status === 'invalid') {
    return { sent: false, reason: v.reason, did_you_mean: v.did_you_mean };
  }

  const res = await fetch('https://api.mailersend.com/v1/email', {
    method: 'POST',
    headers: {
      authorization: 'Bearer ' + process.env.MAILERSEND_API_TOKEN,
      'content-type': 'application/json',
    },
    body: JSON.stringify({
      from: { email: 'hello@yourapp.com', name: 'YourApp' },
      to: [{ email }],
      subject: 'Confirm your email',
      text: 'Confirm your account: ' + link,
    }),
  });
  return { sent: res.ok, check: v?.status ?? 'unchecked' };
}

What to do with each result

pingutil resultAction in MailerSend
status invalid with did_you_meanShow the suggestion before sending the verification link.
status invalid, reason disposable_domainRefuse the trial signup. No MailerSend email is sent.
status risky, reason accept_all or role_basedSend, and flag the account for review if role addresses matter to you.
status unknownSend; the activity.hard_bounced webhook covers the failure case.

Limits to plan for

  • MailerSend offers its own email verification API (single and list). pingutil is an option when you want verification together with disposable, free-webmail and company classification from one API, or across tools other than MailerSend.
  • MailerSend's docs show the recipient at data.recipient for activity events, but note an inconsistency in their FAQ; log a real payload before mapping fields.
  • pingutil's default budget is 300 verified addresses a day (3,000 a month) and 60 requests a minute per account. Over budget you get 429 quota_exceeded; fail open. Those are Free plan limits; Enterprise has custom limits.

MailerSend documentation

MailerSend is a trademark of its owner. This integration uses MailerSend's documented extension points; it is not an official MailerSend app.

Common questions

Why not use MailerSend's built-in verification?
It works for MailerSend sends. Verifying at signup with pingutil gives you the category (disposable, free webmail, company) and the mailbox check in one response you can reuse in your CRM and auth flow.
Does pingutil remove addresses from MailerSend suppressions?
No. Suppressions are managed in MailerSend. pingutil only checks addresses before you send.

Stop bad addresses in MailerSend today

Sign in with your email, create an API key and paste it into the step above. Test on a few real addresses first: the live demo shows exactly what your MailerSend setup will receive.