// transactional email
Via APIResend email verification with pingutil
Resend makes sending from a Next.js or Node app a few lines of code, which also makes it easy to send to every address a form produces. A pingutil check before resend.emails.send keeps invalid and disposable addresses from bouncing on a sending domain that is often brand new, and the email.bounced webhook covers what slips through.
Where it connects: Your route handler before resend.emails.send, plus the email.bounced webhook
What goes wrong without it
- We just set up our domain on Resend and our first week of signups already has bounces from fake addresses.
- Our magic-link login sends an email on every attempt, and bots hammer it with random addresses.
- Bounced addresses go on Resend's suppression list, and users who mistyped their address are locked out of sign-in.
What you can do with Resend and pingutil
Check before sending a magic link
Run the fast lookup with skip_enrichment: true on every login attempt to drop disposable and randomized addresses, so bots cannot use your login form to burn sends.
Verify at signup with a typo prompt
Call /v1/verify on the signup form and return did_you_mean to the client before the welcome email is sent.
Flag users from email.bounced
When the email.bounced webhook reports a Permanent bounce for a user, mark their address and ask them to change it.
Set it up
- 1
Add PINGUTIL_KEY next to RESEND_API_KEY in your environment.
- 2
In the signup or login route handler, call pingutil before resend.emails.send.
- 3
Return a 422 with did_you_mean for invalid addresses; send for everything else.
- 4
Add a webhook in Resend for email.bounced and flag users whose data.bounce.type is Permanent.
// app/api/signup/route.ts
import { Resend } from 'resend';
const resend = new Resend(process.env.RESEND_API_KEY);
const headers = { authorization: 'Bearer ' + process.env.PINGUTIL_KEY, 'content-type': 'application/json' };
async function pingutil(path: string, body: object, ms: number) {
try {
const res = await fetch('https://pingutil.com' + path, {
method: 'POST',
headers,
body: JSON.stringify(body),
signal: AbortSignal.timeout(ms),
});
return res.ok ? await res.json() : null;
} catch {
return null; // fail open on timeouts and errors
}
}
export async function POST(req: Request) {
const { email } = await req.json();
const lookup = await pingutil('/v1/lookup', { input: email, skip_enrichment: true }, 2000);
if (lookup?.verdict?.is_spam) {
return Response.json({ error: 'Please use a permanent email address.' }, { status: 422 });
}
const v = await pingutil('/v1/verify', { email }, 8000);
if (v?.status === 'invalid') {
return Response.json({ error: 'This address cannot receive mail.', did_you_mean: v.did_you_mean }, { status: 422 });
}
const { error } = await resend.emails.send({
from: 'YourApp <hello@yourapp.com>',
to: [email],
subject: 'Welcome to YourApp',
html: '<p>Thanks for signing up.</p>',
});
if (error) return Response.json({ error: error.message }, { status: 502 });
return Response.json({ ok: true, check: v?.status ?? 'unchecked' });
}What to do with each result
| pingutil result | Action in Resend |
|---|---|
| verdict.is_spam true | Return 422 before resend.emails.send. No send, no bounce. |
| status invalid with did_you_mean | Return the suggestion so the user can fix the typo. |
| verdict.low_trust (role or system address) | Allow, but consider a review flag for signups from noreply@ or info@. |
| status risky or unknown | Send, and let the email.bounced webhook flag the user if it fails. |
Limits to plan for
- Resend keeps a suppression list of addresses that bounced or complained; sends to them are not delivered. Verifying first keeps users off that list for avoidable reasons.
- A Vercel or serverless function has its own execution time limit. Keep the verify timeout well under it and fail open.
- pingutil budgets are 300 verified addresses and 2,000 lookups a day (3,000 and 30,000 a month) per account. A login form under bot attack can use those up; rate-limit the form itself too. Those are Free plan limits; Enterprise has custom limits.
Resend documentation
Resend is a trademark of its owner. This integration uses Resend's documented extension points; it is not an official Resend app.
Common questions
- Should I verify on every magic-link login?
- Use the fast lookup on every attempt, since it is quick and catches disposable and random addresses. Run the full mailbox check once, at signup or the first login, and store the result.
- Can I verify in React Email or on the client?
- No. Keep the API key on the server and call pingutil from your route handler or server action.
Stop bad addresses in Resend 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 Resend setup will receive.