← All Posts
Guide

Email Bounce Handling: The Developer's Complete Guide

What are email bounces and why they matter

An email bounce occurs when an email cannot be delivered to the recipient's inbox. Bounces directly impact your sender reputation — the score ISPs use to decide whether your emails reach the inbox or get filtered to spam. A bounce rate above 2% is a red flag for most ISPs, and consistently high bounce rates can result in your sending domain or IP being blacklisted. For SaaS applications, this means your critical transactional emails (password resets, verification codes, invoices) could stop reaching users entirely. Managing bounces isn't just good practice — it's essential for keeping your email infrastructure functional.

Hard bounces vs soft bounces

Hard bounces are permanent delivery failures. The email address doesn't exist, the domain doesn't exist, or the recipient's server has permanently rejected your email. Hard bounces mean you should never send to that address again — continuing to send to hard-bounced addresses is the fastest way to destroy your sender reputation. Common hard bounce reasons: 'User unknown', 'Mailbox not found', 'Domain not found'. Soft bounces are temporary delivery failures. The recipient's mailbox is full, their server is temporarily down, the message is too large, or the server is rate-limiting you. Soft bounces may resolve on their own — the email might be delivered on a retry. However, an address that soft bounces repeatedly (e.g., 3 times across 3 days) should be treated as a hard bounce.

Implementing bounce handling with AISend

AISend reports bounces through two channels: the API response for synchronous rejection, and webhooks for asynchronous bounces. When an email bounces, AISend sends a webhook event with type 'bounced' containing the bounce classification (hard/soft), the error message from the receiving server, and the recipient address. Set up a webhook endpoint in your application to receive these events. For hard bounces, immediately mark the email address as invalid in your database and prevent future sends. For soft bounces, track the count and treat the address as invalid after 3 consecutive soft bounces. AISend's AI automatically suppresses sending to known hard-bounce addresses, providing a safety net even if your application doesn't process bounces immediately.

Building a suppression list

A suppression list is a database of email addresses you should never send to. It should include all hard-bounced addresses, addresses that have unsubscribed, addresses that have filed spam complaints, and addresses you've manually flagged as invalid. Before sending any email, check the recipient against your suppression list. This check should happen at the application level (before calling the email API) for fastest response and lowest cost. Store your suppression list in a fast data store like Redis for O(1) lookup times, with a persistent backup in your primary database. AISend also maintains a provider-level suppression list and will reject sends to known invalid addresses, but building your own list gives you application-level control.

Preventing bounces proactively

The best bounce handling strategy is prevention. Validate email addresses at signup with format validation, DNS MX record checking, and optionally a verification email. Use double opt-in for any mailing list. Clean your email list regularly by removing addresses that haven't engaged in 6+ months. Monitor your bounce rate dashboard daily — a sudden spike usually indicates a data quality issue or a provider problem. AISend's content scoring also helps prevent bounces by flagging content that might trigger spam filters, which can cause soft bounces on strict corporate email servers. Combined with AI-powered provider routing that avoids providers with high bounce rates for specific recipient domains, you can maintain bounce rates well below the 2% threshold that ISPs consider problematic.

Ready to Send Smarter Emails?

1,000 emails/month free. No credit card required.