# Sinch Email Mailgun Send

> Send an email via Mailgun (Sinch) API

- Skill: `sinch/sinch-email-mailgun-send` (Agent Skill)
- Install (CLI): `npx skillmds@latest add sinch/sinch-email-mailgun-send`
- Raw SKILL.md: https://api.skillmd.com/api/skills/sinch/sinch-email-mailgun-send/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: sinch (https://skillmd.com/u/sinch)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/sinch/sinch-email-mailgun-send

---


# Send Email via Mailgun

Send a transactional email using the Mailgun Email API. Uses HTTP Basic Auth (api:API_KEY). Region: US (api.mailgun.net) or EU (api.eu.mailgun.net).

**IMPORTANT: Execute this command directly. Do NOT generate script files. Perform the API call immediately.**

## Input

- `--from` / `-f`: Sender (e.g. "Sender <sender@yourdomain.com>") - required
- `--to` / `-t`: Recipient email address - required
- `--subject` / `-s`: Email subject - required
- `--text` / `-T`: Plain text body - optional (use with or without --html)
- `--html` / `-H`: HTML body - optional
- `--domain` / `-d`: Sending domain (must be verified in Mailgun) - required, or use MAILGUN_DOMAIN env

Arguments: $ARGUMENTS

## Instructions

**Execute these steps directly - do not write code or scripts:**

0. If $ARGUMENTS empty: ask for from, to, subject, and text or html body. Otherwise parse.

1. Validate: --from, --to, --subject; at least one of --text or --html. --domain or MAILGUN_DOMAIN. Get MAILGUN_API_KEY and MAILGUN_DOMAIN from env. Use MAILGUN_REGION (us or eu) for base URL: api.mailgun.net (US) or api.eu.mailgun.net (EU). If missing, report "Mailgun is not configured. Set MAILGUN_API_KEY, MAILGUN_DOMAIN, and optionally MAILGUN_REGION."

2. POST https://{api_host}/v3/{domain}/messages with Basic Auth (username "api", password API_KEY). Form or JSON: from, to, subject, text, html.

3. On success: "✅ Email sent" with message ID. Handle 401, 400, 404 with clear messages.

4. Handle all errors gracefully.

## Examples

```
/sinch-email-mailgun-send --from="Sender <sender@mydomain.com>" --to=recipient@example.com --subject="Hello" --text="Hello from Mailgun"
/sinch-email-mailgun-send -f "Me <me@mydomain.com>" -t user@example.com -s "Test" --html="<p>Hi</p>"
```

## API Reference

- **US**: https://api.mailgun.net/v3/{domain}/messages
- **EU**: https://api.eu.mailgun.net/v3/{domain}/messages
- **Auth**: Basic api:API_KEY

