amp-htmlstring
AMP part of the message. Please follow Google guidelines to compose and send AMP emails
attachmentstring[]
File attachment. You can post multiple attachment values. Important: You must use multipart/form-data encoding for sending attachments
bccstring[]
Same as to but for blind carbon copy recipients. Supports friendly name format.
ccstring[]
Same as to but for carbon copy recipients. Supports friendly name format.
domain_namestringобязательный
Domain name used to send the message
fromstringобязательный
Email address of the From header. Can include a friendly name using the format "Friendly Name <email@domain.com>". Note: not required if sending with a template that has a pre-set From header, but will override the template's From header if provided.
htmlstring
Body of the message (HTML version)
h_X-My-Headerstring
Adds custom headers to the email. Use 'h:' prefix followed by header name and value. Example: 'h:X-Custom-Header=my-value'
inlinestring[]
Attachment with inline disposition. Can be used to send inline images (see example). You can post multiple inline values
o_archive-tostring
Sends a copy of successfully delivered messages to the specified URL via HTTP POST. The request uses Content-Type: application/mime and contains the exact message the recipient's SMTP server received. NOTE: These are accounted for and billed as delivered messages
o_deliver-withinstring
Specifies the maximum time window for delivering the message. Accepts values in format [0-9]+h[0-9]+m (e.g., 1h30m, 30m, 24h), with a minimum of 5m and maximum of 24h. For scheduled messages, the delivery window starts from the scheduled time. The standard retry schedule applies within this window, so shorter timeframes may result in fewer delivery attempts.
o_deliverytimestring
Specifies the scheduled delivery time in RFC-2822 format. Depending on your plan, you can schedule messages up to 3 or 7 days in advance. If your domain has a custom message_ttl (time-to-live) setting, this value determines the maximum scheduling duration. Example: 'Fri, 14 Oct 2011 12:00:00 +0000'
o_deliverytime-optimize-periodstring
Toggles Send Time Optimization (STO) on a per-message basis. String should be set to the number of hours in [0-9]+h format, with the minimum being 24h and the maximum being 72h. This value defines the time window in which Mailgun will run the optimization algorithm based on prior engagement data of a given recipient. See Sending a Message with STO for details. Please note that STO is only available on certain plans. See www.mailgun.com/pricing for more info
o_dkimenum
Enables or disables DKIM signatures on a per-message basis. Overrides the domain-level DKIM setting for this specific message.
o_require-tlsenum
When set to 'yes', requires the message to be sent only over a TLS connection to the Email Service Provider. If TLS cannot be established, the message will not be delivered. When set to 'no' (default), Mailgun attempts TLS but falls back to plaintext SMTP if needed.
o_secondary-dkimstring
Specify a second domain key to sign the email with. The value is formatted as signing_domain/selector, e.g. example.com/s1. This tells Mailgun to sign the message with the signing domain example.com using the selector s1. Note: the domain key specified must have been previously created and activated.
o_secondary-dkim-publicstring
Specify an alias of the domain key specified in o:secondary-dkim. Also formatted as public_signing_domain/selector. o:secondary-dkim option must also be provided. Mailgun will sign the message with the provided key of the secondary DKIM, but use the public secondary DKIM name and selector. Note: We will perform a DNS check prior to signing the message to ensure the public keys matches the secondary DKIM.
o_sending-ipstring
Used to specify an IP Address to send an email that is owned by your account
o_sending-ip-poolstring
If an IP Pool ID is provided, the email will be delivered with an IP that belongs in that pool
o_skip-verificationenum
If true, the certificate and hostname of the resolved MX Host will not be verified when trying to establish a TLS connection. If false, Mailgun will verify the certificate and hostname. If either one can not be verified, a TLS connection will not be established. The default is false
o_suppress-headersstring
Removes specified X-Mailgun headers from the delivered message. Provide header names separated by commas (e.g., 'X-Mailgun-Variables,X-Mailgun-Tag') or use 'all' to remove all X-Mailgun headers.Note: X-Mailgun-Sid header is currently used to process complains received via feedback loops.
o_tagstring[]
Tag string. See Tagging for more information
o_testmodeenum
Enables sending in test mode. Messages are processed normally but not actually delivered to recipients. Useful for testing without sending real emails. See Sending in Test Mode
o_time-zone-localizestring
Toggles Timezone Optimization (TZO) on a per message basis. String should be set to preferred delivery time in HH:mm or hh:mmaa format, where HH:mm is used for 24 hour format without AM/PM and hh:mmaa is used for 12 hour format with AM/PM. See Sending a Message with TZO for details. Please note that TZO is only available on certain plans. See www.mailgun.com/pricing for more info
o_trackingenum
Toggles both click and open tracking on a per-message basis
o_tracking-clicksenum
Toggles click tracking on a per-message basis, see Tracking Clicks. This overrides the domain-level click tracking setting.
o_tracking-opensenum
Toggles opens tracking on a per-message basis, see Tracking Opens. Has higher priority than domain-level setting.
o_tracking-pixel-location-topenum
Places the tracking pixel at the top of emails instead of the bottom. Useful for long emails that may be truncated or have rendering issues, ensuring open tracking works accurately.
recipient-variablesstring
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. Variables can be referenced in the message using %recipient.variablename%. Example: '{"alice@example.com": {"name":"Alice", "id":1}, "bob@example.com": {"name":"Bob", "id":2}}'. Maximum 1,000 recipients per batch. See Batch Sending for more information
subjectstringобязательный
Message subject. Note: not required if sending with a template that has a pre-set Subject header, but it will override it if provided.
templatestring
Name of a template stored via the Templates API to use to render the email body. See Templates for more information
textstring
Body of the message (text version)
tostring[]обязательный
Email address of the recipient(s). Supports friendly name format. Example: "Bob <bob@host.com>". Use commas to separate multiple recipients. Duplicate addresses are automatically ignored.
t_textenum
Generates a plain text version of the template alongside the HTML version when sending templated emails. When set to 'yes', instructs Mailgun to create a text/plain MIME part based on the template content, ensuring compatibility with email clients that don't support HTML or have HTML rendering disabled. This improves email deliverability and accessibility by providing a fallback text version in multipart emails.
t_variablesstring
A valid JSON-encoded dictionary used as the input for template variable expansion. See Templates for more information
t_versionstring
Render a specific version of the given template instead of the latest version. template option must also be provided.
v_my-varstring
Attaches custom data to the message using the 'v:' prefix followed by a variable name. When sending with templates, provides values for template variable substitution (overridden by 't:variables' if both are provided). When not using templates, treated as metadata and included in events/webhooks. Variables are visible in the delivered email's X-Mailgun-Variables header. Example: 'v:user-id=123'. NOTE: Anything over 4KB will be truncated in the event/webhooks.