POST /{mydomain}/messages

Sends a message by assembling it from the components. Note that you can specify most parameters multiple times, HTTP supports this out of the box. This makes sense for parameters like cc, to or attachment.

ParameterDescription
fromEmail address for From header
toEmail address of the recipient(s). Example: "Bob <bob@host.com>". You can use commas to separate multiple recipients.
ccSame as To but for Cc
bccSame as To but for Bcc
subjectMessage subject
textBody of the message. (text version)
htmlBody of the message. (HTML version)
attachmentFile attachment. You can post multiple attachment values. Important: You must use multipart/form-data encoding when sending attachments.
inlineAttachment with inline disposition. Can be used to send inline images (see example). You can post multiple inline values.
o:tagTag string. See Tagging for more information.
o:dkimEnables/disables DKIM signatures on per-message basis. Pass yes or no
o:deliverytimeDesired time of delivery. See Date Format. Note: Messages can be scheduled for a maximum of 3 days in the future.
o:testmodeEnables sending in test mode. Pass yes if needed. See Sending in Test Mode
o:trackingToggles tracking on a per-message basis, see Tracking Messages for details. Pass yes or no.
o:tracking-clicksToggles clicks tracking on a per-message basis. Has higher priority than domain-level setting. Pass yes, no or htmlonly.
o:tracking-opensToggles opens tracking on a per-message basis. Has higher priority than domain-level setting. Pass yes or no.
o:require-tlsIf set to True this requires the message only be sent over a TLS connection. If a TLS connection can not be established, Mailgun will not deliver the message. If set to False, Mailgun will still try and upgrade the connection, but if Mailgun can not, the message will be delivered over a plaintext SMTP connection. The default is False.
o:skip-verificationIf set to True, the certificate and hostname will not be verified when trying to establish a TLS connection and Mailgun will accept any certificate during delivery. If set to 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.
h:X-My-Headerh: prefix followed by an arbitrary value allows to append a custom MIME header to the message (X-My-Header in this case). For example, h:Reply-To to specify Reply-To address.
v:my-varv: prefix followed by an arbitrary name allows to attach a custom JSON data to the message. See Attaching Data to Messages for more information.

Servers

Path parameters

Name Type Required Description
mydomain String Yes

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.