---
title: "Send an email"
method: POST
path: "/emails"
tags: ["Emails"]
---

# Send an email

`POST /emails`

Sends an outbound email message.

## Request body

- EmailSendRequest
  - `from` string, required — - The sender's email. Its domain should be one that has been registered and activated in your account. - The sender's email address is required while the sender's name is optional. For example, both `support@example.com` and `Sender<support@example.com>` work.
  - `to` string, required — - The intended recipients' email addresses. - Supports a comma-separated list of one or more addresses. Max items: 100.
  - `subject` string, required — The email subject, which contains a short string identifying the topic of the message. Max length: 255.
  - `content` string, required — - The email body. Max size: 150 KB. - Variables in the form of `#var_1#` are supported, they should be used together with the `variables` parameter. Variable keys only support letters, digits, and the underline character (`_`). - You can use the [Test Templates](https://helpdocs.ycloud.com/help-center/integrations/channels/email/email-template-samples) provided by YCloud for testing.
  - `contentType` 'text/html' | 'text/plain' — The MIME type of the email content (`text/html` or `text/plain`). Be aware that We won't count click and open events for the type `text/plain`.
  - `variables` object[] — - The variable key-value pairs that will replace the variable placeholders in `content` for each recipient. Variable keys are those that are wrapped with `#` as placeholders (e.g., `#var_1#`) in `content`. The placeholders will be replaced by variable values when sending the email. - The size of the array must be the same as the number of recipients in `to`. Be aware that `cc` and `bcc` addresses are excluded, and they can not receive emails that contain variables. - This parameter's size will be calculated together with the parameter `content`. The whole size must not exceed 150 KB.
  - `cc` string — Recipients who will receive a copy of the email.
  - `bcc` string — Recipients who will receive a blind carbon copy of the email.
  - `replyTo` string — If this field exists, then the reply should go to the addresses indicated in that field and not to the address(es) indicated in the `from` field.
  - `summary` string — This is a summary of your email. Max length: 70.
  - `externalId` string — A unique (recommended) string to reference the object. This can be an order number or similar, and can be used to reconcile the object with your internal systems.
  - `callbackUrl` string — Delivery report URL. You can provide a URL, and we will push the updated status report to your server in time. e.g., https://httpbin.org/anything?tag=api. Note: We recommend configuring Webhook Endpoints instead.

## Response `200`

The request is successfully accepted.

- Email
  - `id` string, required — Unique ID for the object.
  - `from` Mailbox — Represents a mailbox.
    - `name` string — Name of the mailbox.
    - `address` string — Address of the mailbox.
  - `to` Mailbox[] — The intended recipients' email addresses.
    - `name` string — Name of the mailbox.
    - `address` string — Address of the mailbox.
  - `cc` Mailbox[] — Recipients who will receive a copy of the email.
    - `name` string — Name of the mailbox.
    - `address` string — Address of the mailbox.
  - `bcc` Mailbox[] — Recipients who will receive a blind carbon copy of the email.
    - `name` string — Name of the mailbox.
    - `address` string — Address of the mailbox.
  - `replyTo` Mailbox[] — If this field exists, then the reply should go to the addresses indicated in that field and not to the address(es) indicated in the `from` field.
    - `name` string — Name of the mailbox.
    - `address` string — Address of the mailbox.
  - `subject` string — The email subject, which contains a short string identifying the topic of the message.
  - `summary` string — This is a summary of your email. Max length: 70.
  - `contentType` 'text/html' | 'text/plain' — The MIME type of the email content (`text/html` or `text/plain`). Be aware that We won't count click and open events for the type `text/plain`.
  - `externalId` string — A unique (recommended) string to reference the object. This can be an order number or similar, and can be used to reconcile the object with your internal systems.
  - `callbackUrl` string — Delivery report URL. You can provide a URL, and we will push the updated status report to your server in time. e.g., https://httpbin.org/anything?tag=api. Note: We recommend configuring Webhook Endpoints instead.
  - `createTime` string, date-time — The time at which this message was created, formatted in [RFC 3339](https://datatracker.ietf.org/doc/html/rfc3339). e.g., `2022-06-01T12:00:00.000Z`.
  - `totalRecipients` integer — Total recipients of this message, including `to`, `cc` and `bcc`.
  - `totalPrice` number, double — Total price of this message.
  - `currency` string — Price currency. [ISO 4217 currency code](https://en.wikipedia.org/wiki/ISO_4217).

---

[API](https://skmtc.dev/ycloud/apis/ycloud-api.md) · [All operations](https://skmtc.dev/ycloud/apis/ycloud-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ycloud/ycloud-api/revisions/4e13d3ca9df8/schema)
