> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mailchannels.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Email API examples

> Find task-focused examples for sending email, handling delivery events, and integrating MailChannels into common application workflows.

Use these examples when you know what you want to build and need the shortest path to a working implementation.

<CardGroup cols={2}>
  <Card title="Send with cURL" icon="terminal" href="/email-api/curl/quickstart">
    Create an API key, authorize a domain, and send a message from your shell.
  </Card>

  <Card title="Send with Node.js" icon="braces" href="/email-api/javascript/quickstart">
    Send transactional email from a JavaScript or TypeScript application.
  </Card>

  <Card title="Send with attachments" icon="paperclip" href="/email-api/attachments">
    Attach files safely and stay within the encoded message size limit.
  </Card>

  <Card title="Send HTML and plain text" icon="file-code" href="/email-api/content-types">
    Include both rich HTML and a plain-text fallback in the same message.
  </Card>

  <Card title="Send to multiple recipients" icon="users" href="/email-api/how-emails-are-structured">
    Use personalizations to address one or many recipients in a request.
  </Card>

  <Card title="Verify webhook signatures" icon="shield-check" href="/email-api/webhooks#verifying-message-signatures">
    Validate MailChannels webhook signatures before processing events.
  </Card>

  <Card title="Process bounces and complaints" icon="activity" href="/email-api/suppressions-unsubscribes">
    Turn delivery events into suppression and review workflows.
  </Card>

  <Card title="Send via SMTP" icon="send" href="/email-api/smtp-sending">
    Relay through MailChannels from tools that already support SMTP.
  </Card>
</CardGroup>

## Common stack patterns

| Stack | Recommended path |
| - | - |
| Server-rendered web app | Store the API key server-side and call `POST /tx/v1/send` from a backend action or controller. |
| Serverless function | Keep the API key in the platform secrets store, send the request from the function, and return only your own application status to the browser. |
| Queue worker | Add `request_id` or your own correlation ID to logs, retry transient API failures, and process delivery state from webhooks. |
| Legacy mail library | Use [SMTP sending](/email-api/smtp-sending) when your tool cannot call the HTTP API directly. |

## Production recipe checklist

Before you move an example into production:

* Keep API keys in environment variables or a secrets manager.
* Add Domain Lockdown for every sending domain.
* Publish SPF, DKIM, and DMARC records.
* Store the API response `request_id`.
* Configure webhooks and persist raw events before business processing.
* Add suppression handling for hard bounces, complaints, and unsubscribe events.
* Document who owns support escalation for failed or delayed messages.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.