From Sendmux
Sends outbound email via Sendmux HTTP API, SMTP, MCP, CLI, or SDK. Handles single, batch, and attachment sends with idempotency keys.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sendmux:sendmux-send-emailThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill when the user is ready to send outbound email through Sendmux or needs code/commands for sending.
Use this skill when the user is ready to send outbound email through Sendmux or needs code/commands for sending.
smx_mbx_ key or owner-approved Sending-resource smx_agent_ token for the Sending API.smx_agent_ token for sending. Pre-claim self-registered agent tokens have mailbox.read and email.receive, not email.send.smx_agent_ token by exchanging the saved claim_token after owner approval with resource=https://smtp.sendmux.ai/api/v1.| User task | Efficient default |
|---|---|
| One outbound email | POST /emails/send, MCP sending_send_email, CLI sending:send, or SDK sendingSendEmail. |
| More than one independent outbound email | Batch by default: POST /emails/send/batch, MCP sending_send_email_batch, CLI sending:send:batch, or SDK sendingSendEmailBatch. |
| Sending API attachment file | Upload first with sending_upload_attachment, sending_create_attachment_upload, CLI --attach, or SDK file helpers; send by attachment_id. |
| Replying while working inside one mailbox | Use mailbox send from sendmux-mailbox-agent when the workflow is mailbox-centred. |
| Existing app only supports SMTP | Use SMTP only because the existing tool requires it. For new agent or app integrations, prefer the HTTP Sending API. |
Batch sends accept up to 100 messages. A batch response can partially succeed, so inspect every result item.
Single send body:
{
"from": { "email": "[email protected]", "name": "Sender Name" },
"to": { "email": "[email protected]", "name": "Recipient Name" },
"subject": "Subject line",
"html_body": "<p>Hello.</p>",
"text_body": "Hello."
}
Required fields: from, to, subject, html_body.
Useful optional fields:
text_body: plain text alternative.cc, bcc: arrays of recipients, max 100 each.reply_to: one address object.return_path: envelope sender for bounce handling.custom_headers: custom X-* headers.attachments: up to 10 items. Prefer uploaded refs { "attachment_id": "att_..." }. Inline compatibility form uses filename plus base64 content, optional type, and encoding: "base64".For real local files, do not ask the model to produce base64. Route attachment-heavy work to sendmux-attachments; use CLI --attach, SDK file helpers, sending_upload_attachment, or delegated sending_create_attachment_upload, then pass attachment_id refs. Sending uploads cap each file at 18 MiB and the final sent message at 25 MB. Mailbox blob_id refs are for mailbox sends, not Sending API sends.
Batch send body:
{
"messages": [
{
"from": { "email": "[email protected]" },
"to": { "email": "[email protected]" },
"subject": "Hello Alice",
"html_body": "<p>Hi Alice.</p>"
},
{
"from": { "email": "[email protected]" },
"to": { "email": "[email protected]" },
"subject": "Hello Bob",
"html_body": "<p>Hi Bob.</p>"
}
]
}
Add Idempotency-Key to every send that may be retried. Use one stable key per logical email or batch.
409 idempotency_conflict.Use MCP when the user's agent already has the Sending server connected:
sending_send_email.sending_send_email_batch.sending_upload_attachment with file_path.sending_create_attachment_upload, then PUT bytes to the returned URL with the returned headers and no Sendmux API key.sending_get_attachment.Include an idempotency key when the client exposes the header parameter. If the MCP client does not expose headers clearly, use CLI, SDK, or direct HTTP for retry-sensitive sends. For attachments through MCP, use sendmux-attachments so the agent chooses file_path, presigned upload, or tiny inline base64 correctly.
One email:
SENDMUX_API_KEY="$SENDMUX_MBX_KEY" sendmux sending:send \
--idempotency-key "$IDEMPOTENCY_KEY" \
--body '{
"from": { "email": "[email protected]", "name": "Sender Name" },
"to": { "email": "[email protected]", "name": "Recipient Name" },
"subject": "Subject line",
"html_body": "<p>Hello.</p>",
"text_body": "Hello."
}' \
--json
Batch:
SENDMUX_API_KEY="$SENDMUX_MBX_KEY" sendmux sending:send:batch \
--idempotency-key "$IDEMPOTENCY_KEY" \
--body-file ./sendmux-batch.json \
--json
Use --attach ./file.pdf for local files; the CLI uploads bytes first and injects attachment_id refs before sending. Use --body-file for larger JSON payloads or already-prepared Sending API attachment objects.
One email:
import { createSendingClient, sendingSendEmail } from "@sendmux/sending";
const client = createSendingClient({ apiKey: process.env.SENDMUX_API_KEY! });
const response = await sendingSendEmail({
client,
headers: { "Idempotency-Key": idempotencyKey },
body: {
from: { email: "[email protected]", name: "Sender Name" },
to: { email: "[email protected]", name: "Recipient Name" },
subject: "Subject line",
html_body: "<p>Hello.</p>",
text_body: "Hello.",
},
});
console.log(response.data.message_id, response.data.status);
Batch:
import { createSendingClient, sendingSendEmailBatch } from "@sendmux/sending";
const client = createSendingClient({ apiKey: process.env.SENDMUX_API_KEY! });
const response = await sendingSendEmailBatch({
client,
headers: { "Idempotency-Key": idempotencyKey },
body: {
messages,
},
});
for (const result of response.data.results) {
console.log(result.index, result.status, result.message_id, result.error);
}
Use direct HTTP only when MCP, CLI, or SDK is unavailable:
curl -X POST https://smtp.sendmux.ai/api/v1/emails/send \
-H "Authorization: Bearer $SENDMUX_MBX_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-d @sendmux-email.json
Single send success returns a 200 success envelope with:
data.message_id: eml_...data.status: queuedBatch success returns a 200 success envelope with:
data.summary.totaldata.summary.queueddata.summary.faileddata.results[] containing index, status, message_id, and optional errorHandle these errors deliberately:
401: missing, invalid, or revoked key.402: insufficient credits.403: key lacks email.send, is not allowed for the sender, or uses the wrong surface.409: idempotency conflict.413: request body exceeds 25 MB.422: validation failed; read error.errors.429 or 503: retry according to response headers.sendmux-getting-started.sendmux-attachments.sendmux-mailbox-agent.sendmux-cli.sendmux-token-efficient-usage.npx claudepluginhub sendmux/skills --plugin sendmuxGuides selection of the cheapest Sendmux surface (MCP, CLI, SDK, or HTTP) for email API tasks to minimize token cost and round trips. Covers batch operations, cursor pagination, ETags, and conditional requests.
Sends transactional and bulk email via SendGrid v3 Mail Send API. Covers single sends, personalized batch sends with dynamic templates, scheduled sends, attachments, and sandbox mode.
Email delivery patterns including single, batch, scheduled emails and attachment handling. Use when building transactional email systems, batch communication workflows, scheduled delivery, or implementing file/URL attachments with reply-to and CC/BCC functionality.