Send Emails

Send API v3 and v3.1 are part of Mailjet's transactional messaging suite. Send API v3.1 gives more detailed feedback information on your sendings, while Send API v3 gives you a higher sending limit per single API call.

For information on sending email campaigns to a list of contacts, please see the Campaigns section.

post

Send an email message via Send API v3

post

Send an email message via Send API v3.1

post

/send

Send a message via Send API v3. Send API v3 is built mainly for speed, allowing you to send up to 100 messages in a single API call, as opposed to v3.1, where the limit is 50 messages per call. However, it lacks some of the more complex functionalities of Send API v3.1 like detailed feedback information in case of sending errors.

Full API path

https://api.mailjet.com/v3/send

Body parameters

FromEmail

string

Specifies the sender email address:

  1. When Sender is not specified, the email address will be used to send the message. In such cases, it must be a valid, activated sender for this account. See the /sender and /metasender resources for more info.

  2. When Sender is specified as True, your default sender email address will be used to send the message instead, while the FromEmail will be displayed in the recipient's inbox. In such cases, it is not necessary for the FromEmail to be validated. When the default sender and FromEmail domains differ, the information will be displayed in the inbox as From {FromEmail} via / sent on behalf of {default_sender_domain}.

Note: If the FromEmail domain has a DMARC policy in effect (e.g. Yahoo, AOL), the message will not be delivered. Instead, it will either bounce or be considered as Spam.

FromName

string

Sender name that will be displayed in the recipient's mailbox.

Sender

boolean

When true, default sender email address will be used to send the message, while the FromEmail will be displayed in the recipient's inbox. In such cases, it is not necessary for the FromEmail to be verified. However, the information will be displayed in the inbox as From {from_email} via / sent on behalf of {sender_domain}.

Default value: false

Note: This option is disabled by default. Contact the Support team if you want us to enable this setting on a specific API Key.

Recipients

array

A JSON array containing the list of recipients. Must include at least an `Email` property in each element. Required, unless `To` is specified. Cannot be used together with `Cc` and `Bcc`.

Email

string

The email address of the recipient.

Name

string

The name of the recipient. Will be displayed next to the email in the recipient's mailbox.

Vars

string

Variables used in the message content for this recipient. Specified as a JSON array of var_name:var_value. Inserted in the text and/or HTML part of the message as [[var: var_value]].

To

string

The email address (and name, optionally) of the recipients. Interchangeable with Recipients. Acceptable formats are john@example.com or <john@example.com> or "John Doe" <john@example.com>. Can include multiple contacts, which should be separated by commas. Can be used together with Cc and Bcc.

Cc

string

The email address (and name, optionally) of a recipient who is supposed to receive a carbon copy (cc) of this message. Used together with To and Bcc (optional). Acceptable formats are john@example.com or <john@example.com> or "John Doe" <john@example.com>. Can include multiple contacts, which should be separated by commas.

Bcc

string

The email address (and name, optionally) of a recipient who is supposed to receive a blind carbon copy (bcc) of this message. Use this when you do not want your other recipients to see that you are sending a copy of the message to this email address. Used together with To and Cc (optional). Acceptable formats are john@example.com or <john@example.com> or "John Doe" <john@example.com>. Can include multiple contacts, which should be separated by commas.

Subject

string

The email subject line.

Text-part

string

Provides the Text part of the message. Mandatory, if the Html-part parameter is not specified.

Html-part

string

Provides the HTML part of the message. Mandatory, if the Text-part parameter is not specified.

Mj-TemplateID

integer

The Template ID or Name to use as this email content. If the HTML/Text parts are specified, Mj-TemplateID will overwrite them. Equivalent to using the X-MJ-TemplateID header through SMTP.

Mj-TemplateLanguage

boolean

When true, activates the template language processing. Equivalent to using the X-MJ-TemplateLanguage header through SMTP.

Default value: false

Mj-TemplateErrorReporting

string

An email address, where a carbon copy with the error message is sent to in case of sending issues. Can only be used when Mj-TemplateLanguage=true. Equivalent to using the X-MJ-TemplateErrorReporting header through SMTP.

Mj-TemplateErrorDeliver

string

Defines if the message will be delivered if an error is discovered in the templating language. Can only be used when Mj-TemplateLanguage=true. Equivalent to using the X-MJ-TemplateErrorDeliver header through SMTP.

Possible values:

  • deliver
  • 0

Default value: 0

Attachments

array

A JSON object containing descriptions of the files attached to this message. Contains the Filename, Content type and Base64 encoded content of the file. The total size of attachments (including inline) should not exceed 15 MB.

Filename

string

The full name of the file (including the file extension).

Content-type

string

Defines the type of content being sent out using a MIME type. See the official MIME type list for additional information.

Content

string

Base64 encoded content of the attached file.

Inline_attachments

array

A JSON object containing descriptions of the files attached to this message, that are available for inline use. Inline attachments can be visible directly in the body of the message, depending on the email client support. Insert the file into the HTML code of the email by using `cid:Filename`. The total size of attachments (including inline) should not exceed 15 MB.

Filename

string

The full name of the file (including the file extension).

Content-type

string

Defines the type of content being sent out using a MIME type. See the official MIME type list for additional information.

Content

string

Base64 encoded content of the attached file.

Mj-prio

integer

Indicates the processing priority inside your account (API Key) scheduling queue. More information. Equivalent of using X-Mailjet-Prio header through SMTP.

Default value: 2

Mj-campaign

string

Specifies a custom campaign name, to which all messages with this property value will be assigned. If the campaign doesn't already exist it will be automatically created in the Mailjet system. API users are allowed to send multiple emails from the same campaign name to the same contacts. To block this feature, use the Mj-deduplicatecampaign property. Equivalent of using X-Mailjet-Campaign header through SMTP.

Mj-deduplicatecampaign

integer

Enables or disables the option to send messages from the same campaign to the same contact multiple times. Equivalent of using X-Mailjet-DeduplicateCampaign header through SMTP.

Possible values:

  • 0
  • 1

Default value: 0

Mj-trackopen

integer

Enable or disable open tracking on this message. This property will overwrite the preferences selected in the Mailjet account. Equivalent of using X-Mailjet-TrackOpen header through SMTP.

Allowed Values:

  • 0 = use the values specified in the Mailjet account
  • 1 = disable tracking for this message
  • 2 = enable tracking for this message

Default value: 0

Mj-CustomID

string

Select a user-defined custom ID.

Mj-EventPayload

string

Defines a payload attached to the message. The Parse API will return the values in the payload. Any standard format can be used - XML, JSON, CSV etc. Equivalent of using X-MJ-EventPayload header through SMTP.

Mj-MonitoringCategory

string

Name of the Real-time Monitoring category, to which the message will be attached. Equivalent of using X-MJ-MonitoringCategory header through SMTP.

Headers

object

A JSON object containing additional email headers. Specified as {header_name}:{header_value} pairs.

Vars

object

A JSON object containing variables used to modify the content of your email. Specified as {var_name}:{var_value} pairs. Enter the information in the template text / HTML part by using the [[var:{var_name}]] format. Equivalent of using X-MJ-Vars header through SMTP.

Messages

array

An array containing message objects. Used when you want to send multiple messages in a single API call.

FromEmail

string

Specifies the sender email address:

  1. When Sender is not specified, the email address will be used to send the message. In such cases, it must be a valid, activated sender for this account. See the /sender and /metasender resources for more info.

  2. When Sender is specified as True, your default sender email address will be used to send the message instead, while the FromEmail will be displayed in the recipient's inbox. In such cases, it is not necessary for the FromEmail to be validated. When the default sender and FromEmail domains differ, the information will be displayed in the inbox as From {FromEmail} via / sent on behalf of {default_sender_domain}.

Note: If the FromEmail domain has a DMARC policy in effect (e.g. Yahoo, AOL), the message will not be delivered. Instead, it will either bounce or be considered as Spam.

FromName

string

Sender name that will be displayed in the recipient's mailbox.

Sender

boolean

When true, default sender email address will be used to send the message, while the FromEmail will be displayed in the recipient's inbox. In such cases, it is not necessary for the FromEmail to be verified. However, the information will be displayed in the inbox as From {from_email} via / sent on behalf of {sender_domain}.

Default value: false

Note: This option is disabled by default. Contact the Support team if you want us to enable this setting on a specific API Key.

Recipients

array

A JSON array containing the list of recipients. Must include at least an `Email` property in each element. Required, unless `To` is specified. Cannot be used together with `Cc` and `Bcc`.

Email

string

The email address of the recipient.

Name

string

The name of the recipient. Will be displayed next to the email in the recipient's mailbox.

Vars

string

Variables used in the message content for this recipient. Specified as a JSON array of var_name:var_value. Inserted in the text and/or HTML part of the message as [[var: var_value]].

To

string

The email address (and name, optionally) of the recipients. Interchangeable with Recipients. Acceptable formats are john@example.com or <john@example.com> or "John Doe" <john@example.com>. Can include multiple contacts, which should be separated by commas. Can be used together with Cc and Bcc.

Cc

string

The email address (and name, optionally) of a recipient who is supposed to receive a carbon copy (cc) of this message. Used together with To and Bcc (optional). Acceptable formats are john@example.com or <john@example.com> or "John Doe" <john@example.com>. Can include multiple contacts, which should be separated by commas.

Bcc

string

The email address (and name, optionally) of a recipient who is supposed to receive a blind carbon copy (bcc) of this message. Use this when you do not want your other recipients to see that you are sending a copy of the message to this email address. Used together with To and Cc (optional). Acceptable formats are john@example.com or <john@example.com> or "John Doe" <john@example.com>. Can include multiple contacts, which should be separated by commas.

Subject

string

The email subject line.

Text-part

string

Provides the Text part of the message. Mandatory, if the Html-part parameter is not specified.

Html-part

string

Provides the HTML part of the message. Mandatory, if the Text-part parameter is not specified.

Mj-TemplateID

integer

The Template ID or Name to use as this email content. If the HTML/Text parts are specified, Mj-TemplateID will overwrite them. Equivalent to using the X-MJ-TemplateID header through SMTP.

Mj-TemplateLanguage

boolean

When true, activates the template language processing. Equivalent to using the X-MJ-TemplateLanguage header through SMTP.

Default value: false

Mj-TemplateErrorReporting

string

An email address, where a carbon copy with the error message is sent to in case of sending issues. Can only be used when Mj-TemplateLanguage=true. Equivalent to using the X-MJ-TemplateErrorReporting header through SMTP.

Mj-TemplateErrorDeliver

string

Defines if the message will be delivered if an error is discovered in the templating language. Can only be used when Mj-TemplateLanguage=true. Equivalent to using the X-MJ-TemplateErrorDeliver header through SMTP.

Possible values:

  • deliver
  • 0

Default value: 0

Attachments

array

A JSON object containing descriptions of the files attached to this message. Contains the Filename, Content type and Base64 encoded content of the file. The total size of attachments (including inline) should not exceed 15 MB.

Filename

string

The full name of the file (including the file extension).

Content-type

string

Defines the type of content being sent out using a MIME type. See the official MIME type list for additional information.

Content

string

Base64 encoded content of the attached file.

Inline_attachments

array

A JSON object containing descriptions of the files attached to this message, that are available for inline use. Inline attachments can be visible directly in the body of the message, depending on the email client support. Insert the file into the HTML code of the email by using `cid:Filename`. The total size of attachments (including inline) should not exceed 15 MB.

Filename

string

The full name of the file (including the file extension).

Content-type

string

Defines the type of content being sent out using a MIME type. See the official MIME type list for additional information.

Content

string

Base64 encoded content of the attached file.

Mj-prio

integer

Indicates the processing priority inside your account (API Key) scheduling queue. More information. Equivalent of using X-Mailjet-Prio header through SMTP.

Default value: 2

Mj-campaign

string

Specifies a custom campaign name, to which all messages with this property value will be assigned. If the campaign doesn't already exist it will be automatically created in the Mailjet system. API users are allowed to send multiple emails from the same campaign name to the same contacts. To block this feature, use the Mj-deduplicatecampaign property. Equivalent of using X-Mailjet-Campaign header through SMTP.

Mj-deduplicatecampaign

integer

Enables or disables the option to send messages from the same campaign to the same contact multiple times. Equivalent of using X-Mailjet-DeduplicateCampaign header through SMTP.

Possible values:

  • 0
  • 1

Default value: 0

Mj-trackopen

integer

Enable or disable open tracking on this message. This property will overwrite the preferences selected in the Mailjet account. Equivalent of using X-Mailjet-TrackOpen header through SMTP.

Allowed Values:

  • 0 = use the values specified in the Mailjet account
  • 1 = disable tracking for this message
  • 2 = enable tracking for this message

Default value: 0

Mj-CustomID

string

Select a user-defined custom ID.

Mj-EventPayload

string

Defines a payload attached to the message. The Parse API will return the values in the payload. Any standard format can be used - XML, JSON, CSV etc. Equivalent of using X-MJ-EventPayload header through SMTP.

Mj-MonitoringCategory

string

Name of the Real-time Monitoring category, to which the message will be attached. Equivalent of using X-MJ-MonitoringCategory header through SMTP.

Headers

object

A JSON object containing additional email headers. Specified as {header_name}:{header_value} pairs.

Vars

object

A JSON object containing variables used to modify the content of your email. Specified as {var_name}:{var_value} pairs. Enter the information in the template text / HTML part by using the [[var:{var_name}]] format. Equivalent of using X-MJ-Vars header through SMTP.

Responses

Note: You can find all the errors related to API in the error page

Sent

array

Email

string

The email address for the recipient of this message.

MessageID

integer

Unique numeric ID of this message.

post

/send

Send a message via Send API v3.1. Send API v3.1 is built mainly for reliability, providing very detailed information in case of sending errors. This results in a lower sending limit, however - Send API v3.1 allows you to send up to 50 messages in a single API call, as opposed to v3, where the limit is 100 messages per call. Additionally, Send API v3.1 includes a Sandbox mode. When enabled, the API will perform all the required validations and return success or error messages, but the message will not be sent.

Full API path

https://api.mailjet.com/v3.1/send

Body parameters

SandboxMode

boolean

When true, the API call will be run in Sandbox mode. This will disable the delivery of the message, but the API will still perform all necessary validations. You will still receive success or error messages related to the processing of the message. If the message is processed successfully, you will receive the standard response payload but without the Message ID and UUID.

Default value: false

Messages

array

A JSON array containing message objects.

From

object,

A JSON object containing 2 properties - `Email` and `Name`. Specifies the sender name and email address: 1. When `Sender` is not specified, the email address will be used to send the message. In such cases, it must be a valid, activated sender for this account. See the `/sender` and `/metasender` resources for more info. 2. When `Sender` is specified, the `Sender` email address will be used to send the message, while the `From` email address will be displayed in the recipient's inbox. In such cases, it is not necessary for the `From` address to be validated. When the `Sender` and `From` domains differ, the information will be displayed in the inbox as `From {from_email} via / sent on behalf of {sender_domain}`. > Note: If the `From` domain has a DMARC policy in effect (e.g. Yahoo, AOL), the message will not be delivered. Instead, it will either bounce or be considered as Spam.

Email

string, required

The From email address.

Name

string

The name of the sender. Will be displayed next to the sender email in the recipient's mailbox.

Sender

object,

A JSON object containing 2 properties - `Email` and `Name`. Specifies the sender name and email address. Used when you want to send emails on behalf of a different email address. Must be a valid, activated sender for this account. See the `/sender` and `/metasender` resources for more info. Only `Email` is a mandatory property within this object. The `Sender` email address will be used to send the message, while the `From` email address will be displayed in the recipient's inbox. In such cases, it is not necessary for the `From` address to be verified. However, the information will be displayed in the inbox as `From {from_email} via / sent on behalf of {sender_domain}`. > Note: This option is disabled by default. Contact the Support team if you want us to enable this setting on a specific API Key.

Email

string, required

The email address used to send the message.

Name

string

User-selected name for the Sender email address.

To

array

A JSON array of recipients. Each recipient object within the array may contain the name, but must always contain the recipient email.

Email

string

The email address of the recipient.

Name

string

The name of the recipient. Will be displayed next to the recipient's email in their mailbox.

Cc

array

A JSON array of recipients who are supposed to receive a carbon copy (cc) of this message. Used together with `To` and `Bcc` (optional). Each recipient object within the array may contain the name, but must always contain the recipient email.

Email

string

The email address of the recipient.

Name

string

The name of the recipient. Will be displayed next to the recipient's email in their mailbox.

Bcc

array

A JSON array recipients who are supposed to receive a blind carbon copy (bcc) of this message. Use this when you do not want your other recipients to see that you are sending a copy of the message to this email address. Used together with `To` and `Cc` (optional). Each recipient object within the array may contain the name, but must always contain the recipient email.

Email

string

The email address of the recipient.

Name

string

The name of the recipient. Will be displayed next to the recipient's email in their mailbox.

ReplyTo

object,

A JSON array containing the email address and name (optional), to which replies to this message will go.

Email

string, required

The reply-to email address.

Name

string

The name of the reply-to contact. Will be displayed next to the reply-to email in the respective mailbox.

Subject

string

The email subject line.

TextPart

string

Provides the Text part of the message. Mandatory, if the HTMLPart and TemplateID parameters are not specified.

HTMLPart

string

Provides the HTML part of the message. Mandatory, if the TextPart and TemplateID parameters are not specified.

TemplateID

integer

Unique numeric ID of the template to be used as email content. If the HTML/Text parts are specified, TemplateID will overwrite them. Equivalent to using the X-MJ-TemplateID header through SMTP.

TemplateLanguage

boolean

When true, activates the template language processing. Equivalent to using the X-MJ-TemplateLanguage header through SMTP.

Default value: false

TemplateErrorReporting

object,

An object containing the email address and name of the recipient, to whom a carbon copy with the error message is sent to in case of sending issues. Can only be used when `TemplateLanguage=true`. Equivalent to using the `X-MJ-TemplateErrorReporting` header through SMTP.

Email

string, required

The email address, to which the carbon copy of the email with the error message will be sent.

Name

string

The name of the recipient, to whom the carbon copy of the email with the error message will be sent.

TemplateErrorDeliver

boolean

When true, the message delivery will proceed if an error is discovered in the templating language. When false, the message delivery will be stopped. Can only be used when TemplateLanguage=true. Equivalent to using the X-MJ-TemplateErrorDeliver header through SMTP.

Default value: false

Attachments

array

A JSON array containing descriptions of the files attached to this message. The array contains the Filename, Content type and Base64 encoded content of the file. The total size of attachments (including inline) should not exceed 15 MB.

Filename

string

The full name of the file (including the file extension).

ContentType

string

Defines the type of content being sent out using a MIME type. See the official MIME type list for additional information.

Base64Content

string

Base64 encoded content of the attached file.

InlinedAttachments

array

A JSON array containing descriptions of the files attached to this message, that are available for inline use. Inline attachments can be visible directly in the body of the message, depending on the email client support. Insert the file into the HTML code of the email by using `cid:Filename`, or, if you have specified `ContentID`, by using `cid:ContentID`. The total size of attachments (including inline) should not exceed 15 MB.

Filename

string

The full name of the file (including the file extension).

ContentType

string

Defines the type of content being sent out using a MIME type. See the official MIME type list for additional information.

Base64Content

string

Base64 encoded content of the attached file.

ContentID

string

Name of the cid to be inserted in the HTML content of the message. The value must be unique across all inline attachments in the message.

Priority

integer

Indicates the processing priority inside your account (API Key) scheduling queue. More information. Equivalent of using X-Mailjet-Prio header through SMTP.

Default value: 2

CustomCampaign

string

Specifies a custom campaign name, to which all messages with this property value will be assigned. If the campaign doesn't already exist it will be automatically created in the Mailjet system. API users are allowed to send multiple emails from the same campaign name to the same contacts. To block this feature, use the DeduplicateCampaign property. Equivalent of using X-Mailjet-Campaign header through SMTP.

DeduplicateCampaign

boolean

Enables or disables the option to send messages from the same campaign to the same contact multiple times. Equivalent of using X-Mailjet-DeduplicateCampaign header through SMTP.

Default value: false

TrackOpens

string

Enable or disable open tracking on this message. This property will overwrite the preferences selected in the Mailjet account. Equivalent of using X-Mailjet-TrackOpen header through SMTP.

Allowed Values:

  • account_default = use the values specified in the Mailjet account
  • disabled = disable tracking for this message
  • enabled = enable tracking for this message

Default value: account_default

TrackClicks

string

Enable or disable open tracking on this message. This property will overwrite the preferences selected in the Mailjet account. Equivalent of using X-Mailjet-TrackClick header through SMTP.

Allowed Values:

  • account_default = use the values specified in the Mailjet account
  • disabled = disable tracking for this message
  • enabled = enable tracking for this message

Default value: account_default

CustomID

string

Select a user-defined custom ID.

EventPayload

string

Defines a payload attached to the message. The Parse API will return the values in the payload. Any standard format can be used - XML, JSON, CSV etc. Equivalent of using X-MJ-EventPayload header through SMTP.

MonitoringCategory

string

Name of the Real-time Monitoring category, to which the message will be attached. Equivalent of using X-MJ-MonitoringCategory header through SMTP.

URLTags

string

URL tags to append every URL link in the message. The user needs to provide the query between the ? and # characters in the URL. The URLTags value needs to be URL-encoded.

Headers

object

A JSON object containing additional email headers. Specified as {header_name}:{header_value} pairs.

Variables

object

A JSON object containing variables used to modify the content of your email. Specified as {var_name}:{var_value} pairs. Enter the information in the template text / HTML part by using the [[var:{var_name}]] format. Equivalent of using X-MJ-Vars header through SMTP.

Responses

Note: You can find all the errors related to API in the error page

Messages

array

Status

string

Indicates the sending status of the message.

Possible values:

  • success
  • error

Errors

array

A JSON array containing information about any errors with the processing of this message. Will be displayed only if processing errors occur. Each error will generate a separate error object with the below properties.

ErrorIdentifier

string

A 128-bit universally unique identifier (UUID) for this error.

ErrorCode

string

An internal Mailjet error code for this error. See Send API Errors for more information.

StatusCode

integer

The error status code. See Send API Errors for more information.

ErrorMessage

string

An error message informing the user what the issue is.

ErrorRelatedTo

object

Indicates which part of the payload this error is related to.

CustomID

string

A user-defined custom ID.

To

array

A JSON array containing information about the messages sent to recipients in To.

Email

string

The email address of this recipient.

MessageUUID

string

A 128-bit universally unique identifier (UUID) for this message.

MessageID

integer

Unique numeric ID of this message.

MessageHref

string

URL link that can be used for an API call to retrieve more information about this message.

Cc

array

A JSON array containing information about the messages sent to recipients in Cc.

Email

string

The email address of this recipient.

MessageUUID

string

A 128-bit universally unique identifier (UUID) for this message.

MessageID

integer

Unique numeric ID for this message.

MessageHref

string

URL link that can be used for an API call to retrieve more information about this message.

Bcc

array

A JSON array containing information about the messages sent to recipients in Bcc.

Email

string

The email address of this recipient.

MessageUUID

string

A 128-bit universally unique identifier (UUID) for this message.

MessageID

integer

Unique numeric ID for this message.

MessageHref

string

URL link that can be used for an API call to retrieve more information about this message.