Send an email through Mailgun. Provide the components of the message (from, to, subject, and a body) and Mailgun builds the MIME representation and sends it; at least one of text, html, amp-html, or template is required for the body. Supports CC/BCC, scheduled/optimized delivery, per-message DKIM and TLS overrides, click/open tracking controls, tagging, template rendering with variables, a Reply-To header, and batch personalization via recipient-variables. To/CC/BCC each take a single string value — comma-separate multiple addresses within that one field (e.g. "bob@host.com,alice@host.com"); do not pass a JSON array. Send options (o:, h:, t:, v: prefixed parameters) are limited to 16KB total. Note: binary attachments and inline file content are not supported by this tool — send text/HTML/template-based email only. Mailgun's generic per-message custom headers (h:*) and custom variables (v:*) beyond the dedicated Reply-To field are also not supported, since they require dynamically-named fields that this tool's fixed input schema cannot represent; use Recipient Variables for per-recipient custom data instead.
Parameters
Domain name to send the email through, e.g. mg.example.com.
Email address(es) of the recipient(s). For multiple recipients, separate addresses with a comma in this single value, e.g. "bob@host.com,alice@host.com" — do NOT pass a JSON array (Mailgun's form-encoded API expects one comma-joined value here, not repeated/indexed keys). Supports friendly name format, e.g. "Bob ". Duplicate addresses are automatically ignored.
AMP part of the message. Follow Google's AMP for Email guidelines when composing this content.
Same as `to` but for blind carbon copy recipients. For multiple BCC recipients, separate addresses with a comma in this single value — do NOT pass a JSON array. Supports friendly name format.
Same as `to` but for carbon copy recipients. For multiple CC recipients, separate addresses with a comma in this single value — do NOT pass a JSON array. Supports friendly name format.
Email address for the From header. Can include a friendly name, e.g. "Excited User ". Not required if sending with a template that has a pre-set From header (in which case this overrides it if provided); otherwise required.
Body of the message (HTML version). At least one of text, html, amp-html, or template is required.
Sends a copy of the successfully delivered message as an HTTP POST (Content-Type application/mime) to this URL, containing exactly what the recipient's SMTP server received. Billed as a delivered message.
Maximum time window for delivering the message, in `[0-9]+h[0-9]+m` format (e.g. `1h30m`, `30m`, `24h`), minimum 5m, maximum 24h. For scheduled messages, the window starts from the scheduled time.
Schedules delivery for a future time, in RFC-2822 format. Depending on your plan you can schedule up to 3 or 7 days in advance (or your domain's custom message_ttl).
o_deliverytime_optimize_period
Toggles Send Time Optimization (STO) per message. Set to the number of hours in `[0-9]+h` format, min 24h, max 72h. Only available on certain plans.
Enables or disables DKIM signatures on a per-message basis, overriding the domain-level DKIM setting for this message.
If 'yes', requires the message to be sent only over a TLS connection; if TLS can't be established the message is not delivered. If 'no' (default), Mailgun attempts TLS but falls back to plaintext SMTP.
Specify a second domain key to sign the email with, formatted as `signing_domain/selector` (e.g. `example.com/s1`). The domain key must already exist and be activated.
Alias of the domain key specified in Secondary DKIM, formatted as `public_signing_domain/selector`. Secondary DKIM must also be provided.
Specify a dedicated IP address (owned by your account) to send this message from.
If provided, the email is delivered using an IP from this IP Pool ID.
If 'yes', the certificate and hostname of the resolved MX host are not verified when establishing TLS. If 'no' (default), Mailgun verifies them and won't establish a TLS connection if verification fails.
Removes specified X-Mailgun headers from the delivered message. Comma-separated header names, or 'all' to remove all X-Mailgun headers. Note: X-Mailgun-Sid is used to process complaints from feedback loops.
Tag string(s) to attach to the message for tracking/analytics purposes. Up to 3 tags per message.
Enables sending in test mode: the message is processed normally but not actually delivered to recipients. Set to 'yes' to enable.
Toggles Timezone Optimization (TZO) per message. Set to the preferred delivery time in `HH:mm` (24h) or `hh:mmaa` (12h with AM/PM) format. Only available on certain plans.
Toggles both click and open tracking on a per-message basis, overriding the domain-level setting.
Toggles click tracking on a per-message basis, overriding the domain-level click-tracking setting. 'htmlonly' rewrites links only in the HTML part.
Toggles open tracking on a per-message basis. Has higher priority than the domain-level setting.
o_tracking_pixel_location_top
Places the open-tracking pixel at the top of the email instead of the bottom. Useful for long emails that may be truncated or have rendering issues.
A JSON-encoded dictionary for batch sending with personalized variables per recipient. Each key is a recipient email address; each value is a dictionary of variables for that recipient, referenced in the message as %recipient.variablename%. Maximum 1,000 recipients per batch.
Sets a Reply-To header on the message via Mailgun's custom-header mechanism (sent as the `h:Reply-To` form field). This is the only individually-addressable custom header exposed by this tool; Mailgun's general h: mechanism for arbitrary custom headers is not otherwise supported because it requires a dynamic field name that this tool's fixed set of inputs can't represent.
Message subject. Not required if sending with a template that has a pre-set Subject header (in which case this overrides it if provided); otherwise a subject or a template with a preset subject is expected.
Generates a plain-text version of the template alongside the HTML version. Set to 'yes' to have Mailgun create a text/plain MIME part from the template content, improving deliverability/accessibility.
A valid JSON-encoded dictionary used as input for template variable expansion.
Render a specific version of the given template instead of the latest version. The `template` field must also be provided.
Name of a template stored via the Templates API to use to render the email body. If provided, text/html/amp-html are optional.
Body of the message (plain-text version). At least one of text, html, amp-html, or template is required.