---
title: "Send a batch of emails"
method: POST
path: "/email/batch"
tags: ["EMAILS"]
---

# Send a batch of emails

`POST /email/batch`

Send a batch of emails

## Request body

- object
  - `emails` object[], required — An array of email objects to schedule
    - `sender` string, required — The name and email address to send from, in the format `Name <name@example.com>`
    - `to` string[], required — An array of names and email addresses (up to 100) to send to, in the format `Name <name@example.com>`
    - `cc` string[] — An array of names and email addresses (up to 100) to CC, in the format `Name <name@example.com>`
    - `bcc` string[] — An array of names and email addresses (up to 100) to BCC, in the format `Name <name@example.com>`
    - `subject` string, required — The subject of the email to be sent
    - `html_body` string — A HTML encoded email body. Either html_body or text_body is required if template_id is not passed.<br><br> <strong>Warning:</strong><ul><li>To correctly track clicking of URLs you must: <ul><li>Enable click tracking for the API key</li> <li>Insert a full anchor HTML element (not just the URL)</li> <li>Include "https://" at the start of the HREF property</li> </ul></ul>
    - `text_body` string — A plain text email body. Either html_body or text_body is required if template_id is not passed
    - `custom_headers` object[] — An array of custom header objects to be applied to the email. For example, a `Reply-To` email can be specified here, with header `Reply-To` and value `name@example.com`. For sending purposes the following headers are not allowed `Content-Type`, `Content-Transfer-Encoding` and `MIME-Version`.
      - `header` string, required — Custom header to add to the email
      - `value` string, required — Custom header value to set
    - `attachments` object[] — An array of attachment objects to be attached to the email
      - `filename` string, required — The filename to use for this binary data
      - `fileblob` string — The Base64 encoded binary data of the file. Required if no url is specified.
      - `mimetype` string — The mimetype of the binary data
      - `url` string — A URL pointing to the attachment data. The data is directly retrieved by our system, and cached for fast re-use for 24 hours. Required if no fileblob is specified
    - `inlines` object[] — An array of images to be inlined into the email. Use an image in content as `<img src="cid:filename" />`
      - `filename` string, required — The filename to use for this binary data
      - `fileblob` string — The Base64 encoded binary data of the file. Required if no url is specified.
      - `mimetype` string — The mimetype of the binary data
      - `url` string — A URL pointing to the attachment data. The data is directly retrieved by our system, and cached for fast re-use for 24 hours. Required if no fileblob is specified
    - `template_id` string — The ID of the template you wish to use
    - `template_data` string, json — When a template_id is provided, include the pass-through values in the format `{"variable1": "value1", "variable2": "value2"}`
    - `schedule` string — A timestamp that when passed allows you to schedule an email for sending. Must be in the future and within the next 3 days.<br />The api response will include a `schedule_id` property which can then be used alongside webhooks (An `X-Smtp2go-Schedule-Id` header is added to the sent email corresponds to this id). A total of 50,000 emails can be queued at any one time.

## Response `200`

An array of `email_id/schedule_id` values coinciding with the same order as the request payload.

- object
  - `request_id` string
  - `data` object[] — An array of `email_id/schedule_id` information in the same order as the payload.
    - `email_id` string — The email_id of the email
    - `schedule_id` string — The schedule_id of the email (if `schedule` was passed, used to search/remove scheduled emails)

## Other responses

- `400` — 400

---

[API](https://skmtc.net/smtp2go/apis/smtp2go-api-v3-0-4.md) · [All operations](https://skmtc.net/smtp2go/apis/smtp2go-api-v3-0-4/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/smtp2go/smtp2go-api-v3-0-4/versions/1ba6b25eebb9/schema)
