---
title: "Send a transactional email"
method: POST
path: "/smtp/email"
tags: ["Transactional emails"]
---

# Send a transactional email

`POST /smtp/email`

## Request body

- SendSmtpEmail
  - `sender` SendSmtpEmailSender — Mandatory if `templateId` is not passed. Pass `name` (optional) and `email` OR `id` of sender from which emails will be sent. `name` will be ignored if passed along with sender `id`. For example, {"name":"Mary from MyShop", "email":"no-reply@myshop.com"} or {"id":2}
    - `name` string — Name of the sender from which the emails will be sent. Maximum allowed characters are 70. Applicable only when email is passed.
    - `email` string, email — Email of the sender from which the emails will be sent. Mandatory if sender id is not passed.
    - `id` integer — Id of the sender from which the emails will be sent. In order to select a sender with specific pool of IP’s, dedicated ip users shall pass id (instead of email). Mandatory if email is not passed.
  - `to` SendSmtpEmailTo[] — Mandatory if messageVersions are not passed, ignored if messageVersions are passed. List of email addresses and names (optional) of the recipients. For example, [{"name":"Jimmy", "email":"jimmy98@example.com"}, {"name":"Joe", "email":"joe@example.com"}]
    - `email` string, email, required — Email address of the recipient
    - `name` string — Name of the recipient. Maximum allowed characters are 70.
  - `bcc` SendSmtpEmailBcc[] — List of email addresses and names (optional) of the recipients in bcc
    - `email` string, email, required — Email address of the recipient in bcc
    - `name` string — Name of the recipient in bcc. Maximum allowed characters are 70.
  - `cc` SendSmtpEmailCc[] — List of email addresses and names (optional) of the recipients in cc
    - `email` string, email, required — Email address of the recipient in cc
    - `name` string — Name of the recipient in cc. Maximum allowed characters are 70.
  - `htmlContent` string — HTML body of the message ( Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed )
  - `textContent` string — Plain Text body of the message ( Ignored if 'templateId' is passed )
  - `subject` string — Subject of the message. Mandatory if 'templateId' is not passed
  - `replyTo` SendSmtpEmailReplyTo — Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, {"email":"ann6533@example.com", "name":"Ann"}.
    - `email` string, email, required — Email address in reply to
    - `name` string — Name in reply to. Maximum allowed characters are 70.
  - `attachment` SendSmtpEmailAttachment[] — Pass the absolute URL (no local file) or the base64 content of the attachment along with the attachment name (Mandatory if attachment content is passed). For example, `[{"url":"https://attachment.domain.com/myAttachmentFromUrl.jpg", "name":"myAttachmentFromUrl.jpg"}, {"content":"base64 example content", "name":"myAttachmentFromBase64.jpg"}]`. Allowed extensions for attachment file: xlsx, xls, ods, docx, docm, doc, csv, pdf, txt, gif, jpg, jpeg, png, tif, tiff, rtf, bmp, cgm, css, shtml, html, htm, zip, xml, ppt, pptx, tar, ez, ics, mobi, msg, pub, eps, odt, mp3, m4a, m4v, wma, ogg, flac, wav, aif, aifc, aiff, mp4, mov, avi, mkv, mpeg, mpg, wmv, pkpass and xlsm ( If 'templateId' is passed and is in New Template Language format then both attachment url and content are accepted. If template is in Old template Language format, then 'attachment' is ignored )
    - `url` string, url — Absolute url of the attachment (no local file).
    - `content` string, byte — Base64 encoded chunk data of the attachment generated on the fly
    - `name` string — Required if content is passed. Name of the attachment
  - `headers` object — Pass the set of custom headers (not the standard headers) that shall be sent along the mail headers in the original email. 'sender.ip' header can be set (only for dedicated ip users) to mention the IP to be used for sending transactional emails. Headers are allowed in `This-Case-Only` (i.e. words separated by hyphen with first letter of each word in capital letter), they will be converted to such case styling if not in this format in the request payload. For example, `{"sender.ip":"1.2.3.4", "X-Mailin-custom":"some_custom_header", "idempotencyKey":"abc-123"}`.
  - `templateId` integer — Id of the template.
  - `params` object — Pass the set of attributes to customize the template. For example, {"FNAME":"Joe", "LNAME":"Doe"}. It's considered only if template is in New Template Language format.
  - `messageVersions` SendSmtpEmailMessageVersions[] — You can customize and send out multiple versions of a mail. templateId can be customized only if global parameter contains templateId. htmlContent and textContent can be customized only if any of the two, htmlContent or textContent, is present in global parameters. Some global parameters such as **to(mandatory), bcc, cc, replyTo, subject** can also be customized specific to each version. Total number of recipients in one API request must not exceed 2000. However, you can still pass upto 99 recipients maximum in one message version. The size of individual params in all the messageVersions shall not exceed 100 KB limit and that of cumulative params shall not exceed 1000 KB. You can follow this **step-by-step guide** on how to use **messageVersions** to batch send emails - https://developers.brevo.com/docs/batch-send-transactional-emails
    - `to` SendSmtpEmailTo1[], required — List of email addresses and names (_optional_) of the recipients. For example, [{"name":"Jimmy", "email":"jimmy98@example.com"}, {"name":"Joe", "email":"joe@example.com"}]
      - `email` string, email, required — Email address of the recipient
      - `name` string — Name of the recipient. **Maximum allowed characters are 70**.
    - `params` object — Pass the set of attributes to customize the template. For example, {"FNAME":"Joe", "LNAME":"Doe"}. It's considered only if template is in New Template Language format.
    - `bcc` SendSmtpEmailBcc[] — List of email addresses and names (optional) of the recipients in bcc
      - `email` string, email, required — Email address of the recipient in bcc
      - `name` string — Name of the recipient in bcc. Maximum allowed characters are 70.
    - `cc` SendSmtpEmailCc[] — List of email addresses and names (optional) of the recipients in cc
      - `email` string, email, required — Email address of the recipient in cc
      - `name` string — Name of the recipient in cc. Maximum allowed characters are 70.
    - `replyTo` SendSmtpEmailReplyTo1 — Email (required), along with name (optional), on which transactional mail recipients will be able to reply back. For example, {"email":"ann6533@example.com", "name":"Ann"}
      - `email` string, email, required — Email address in reply to
      - `name` string — Name in reply to. Maximum allowed characters are 70.
    - `subject` string — Custom subject specific to message version
    - `htmlContent` string — HTML body of the message. **Mandatory if 'templateId' is not passed, ignored if 'templateId' is passed**
    - `textContent` string — Plain Text body of the message. **Ignored if 'templateId' is passed**
  - `tags` string[] — Tag your emails to find them more easily
  - `scheduledAt` string, date-time — UTC date-time on which the email has to schedule (YYYY-MM-DDTHH:mm:ss.SSSZ). Prefer to pass your timezone in date-time format for scheduling. There can be an expected delay of +5 minutes in scheduled email delivery. **Please note this feature is currently a public beta**.
  - `batchId` string — Valid UUIDv4 batch id to identify the scheduled batches transactional email. If not passed we will create a valid UUIDv4 batch id at our end.

## Response `201`

transactional email sent

- CreateSmtpEmail
  - `messageId` string — Message ID of the transactional email sent
  - `messageIds` string[]

## Other responses

- `202` — transactional email scheduled
- `400` — bad request

---

[API](https://skmtc.net/getbrevo/apis/brevo-api.md) · [All operations](https://skmtc.net/getbrevo/apis/brevo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getbrevo/brevo-api/versions/2aec3cf66501/schema)
