Skip to main content
A successful sendEmail response means the BosonMail API accepted your message, not that it reached the recipient. This guide shows you how to interpret statuses, persist message IDs, poll with backoff, and build a background reconciliation job so you always know the final outcome.

Accepted vs delivered

When sendEmail returns success: true, the email is typically "queued". It then moves through states such as "sent", "delivered", or terminal states like "failed", "bounced", and "rejected". The exact transition order and meaning of each value is defined by the BosonMail backend and is not fully documented by BosonWare.
The general meaning of status values is described below, but confirm the exact semantics and transitions with BosonWare. Contact support@bosonware.com for authoritative definitions.
Terminal statuses you can stop polling on are: delivered, failed, bounced, rejected. Do not treat deferred or sent as terminal.

Persist message IDs

Store the messageId from every successful send so you can check status later. A minimal database schema might look like this:
schema.sql
After each send, insert a row:
persist.ts

Poll with backoff

The SDK does not poll automatically. Use getEmailStatus in a loop with a delay between attempts. Stop when you reach a terminal status or the maximum number of attempts.
poll-status.ts

Background reconciliation job

For production workloads, run a scheduled job that checks all pending messages instead of polling inline after every send.
reconcile-job.ts
Run this on a cron schedule (for example, every 5 minutes) or with setInterval in a long-running worker process.

Error codes to watch for

Do not poll from browsers

getEmailStatus requires your BosonMail API key. Never call it from browser code. Run polling and reconciliation jobs on your server or in a secure background worker.

Delivery lifecycle diagram

Next steps

Production best practices

Secure keys, handle timeouts, and manage retries in production environments.

SDK reference: Email status

Read the concise SDK reference for getEmailStatus and status fields.

Error handling

Understand all SDK error shapes and how to respond to each.

First email

Return to the basics: send your first email and check its status.