---
title: "send an email"
method: POST
path: "/mail/send"
tags: ["Email API"]
---

# send an email

`POST /mail/send`

## Request

- Base URL: `https://emailapi.netcorecloud.net/v5.1`
- URL: `https://emailapi.netcorecloud.net/v5.1/mail/send`
- Auth: API key in header `api_key`

API endpoint URL for non-EU customers - https://emailapi.netcorecloud.net/

API endpoint for EU customers - 
https://apieu.netcorecloud.net/


**Send Email API** allows you to send emails to your recipients using your **sending domain**. Each API call will enable you to send an email to single or multiple recipients. <br>
Email API processes your requests, generates emails using the values defined in the API request and sends the emails to the recipients.

The nucleus of the Send Email API is the `personalizations` object. The way you use the `personalizations` object would give you the flexibility to modify
* the number of recipients who would receive the emails
* the subject of the mail
* the content of the mail
* the recipients marked as a copy in Cc or Bcc.

The `settings` object allows you to configure the engagement tracking, scheduling information, global bcc and other advance control of your email delivery.

### What is personalization?<br>
You can use Send Email API to send a common content to multiple recipients, and `personalizations` aims to enable you to substitute few elements of your common content and personalize the email for recipients enlisted in a single personalization object.<br>
With each personalization object, you can define a different set of recipients and modify the content with distinct values passed in attributes object.

Personalization enables you to send a unique email to each recipient set, derived from a shared template or content.

### What are tags?<br>
`tags` is a highly useful parameter which, when judiciously used, helps you to distinguish your emails in unique groups/segments.<br>
If you are going to use Email API to send different type of emails, It makes sense to segment your emails and analyze the delivery & engagement performance for each segment.
For instance - If you are sending signup confirmation and festive season offers through Email API, `tags` enable you to segregate those emails in two categories and provide you with the tag wise performance reports.

## Headers

- `api_key` string, required

## Request body

- object
  - `from` object: An object containing the email address and name of the sender.
    - `email` string, required: Email address of the sender. For example : info@example.com <br> Make sure to use the domain with the 'active' status in your Pepipost account. Domains which are not added & activated with your Pepipost account are not authorized to send emails.
    - `name` string: Name of the sender.
  - `reply_to` string: The email address to which recipients can reply back to.
  - `subject` string, required: The subject of the email.<br> You can also personalize the subject line by passing the attribute key between [% %] identifier.
  - `template_id` integer: The Id number associated with the template. <br>You can find the template Id in Settings->Templates
  - `tags` string[]: The keyword to associate this email request to a particular type of email communication. <br>Tagging helps in segregating emails for later reference.
  - `content` object[], required: The content of the mail. <br><br> You can display dynamic values in content using identifiers such as [% NAME %] for NAME , [% AGE %] for AGE and passing dynamic values in attributes object.
    - `type` string, required: Indicate if the content type is <b>'html'</b> or <b>'amp'</b>.<br> If you are using content type 'amp', then make sure to also pass equivalent content with type 'html' to maintain fallback for devices or email applications that do not support AMP.
    - `value` string, required: Pass the content which is synonymous with the format indicated in the 'type' parameter.
  - `attachments` object[]: An array of objects to send emails with one or more attachments.
    - `name` string: Name of the attachment. <br> e.g. invoice.pdf or statement.xls
    - `content` string: base64 encoded value of the attached file. <br>e.g if you want to attach a 'invoice.pdf' file, then convert the file content first in base64 and pass the value in this parameter.
  - `personalizations` object[]: An object to forward the recipient details, pass dynamic values for personalization and send unique token values for each recipient type.
    - `attributes` object: The attributes object is a collection of key-value pairs to facilitate personalization. The attributes object contains keywords & their respective substitution data, which will indicate how Pepipost should modify the body content and the subject of your email while processing the request. Pass the keywords in body content and subject line within [% %] identifiers to indicate the placement of data to be dynamically substituted. Check the FAQs in our API Documentation to understand 'Personalization' & how to use attributes.
    - `to` object[]: An array of objects to provide recipients information. <br> Each object indicates one recipient and contains the email address & name of the recipient.
      - `email` string, required: The email address of the recipient.
      - `name` string: The name of the recipient
    - `cc` object[]: An array of objects to provide recipients information which will be marked as carbon copy(Cc). <br> Each object indicates one recipient email address.
      - `email` string: The email address of the recipient.
    - `bcc` object[]: An array of objects to provide recipients information which will be marked as blind carbon copy(Cc). <br> Each object indicates one recipient email address.
      - `email` string: The email address of the recipient.
    - `token_to` string: Pass a JSON format value in this string parameter for your reference. Tokens are the unique identifiers that are specific to the personalization & recipients listed in 'to'. Example: You can pass InvoiceID, TransactionID, MessageID in this parameter. We will associate & store the token value with the respective emails and highlight them in reports and over webhooks. You can learn more about tokens in the FAQ section of this API Documentation.
    - `token_cc` string: Pass a JSON format value in this string parameter for your reference. Tokens are the unique identifiers that are specific to the personalization & recipients listed in 'to'. Example: You can pass InvoiceID, TransactionID, MessageID in this parameter. We will associate & store the token value with the respective emails and highlight them in reports and over webhooks. You can learn more about tokens in the FAQ section of this API Documentation.
    - `token_bcc` string: Pass a JSON format value in this string parameter for your reference. Tokens are the unique identifiers that are specific to the personalization & recipients listed in 'to'. Example: You can pass InvoiceID, TransactionID, MessageID in this parameter. We will associate & store the token value with the respective emails and highlight them in reports and over webhooks. You can learn more about tokens in the FAQ section of this API Documentation.
    - `attachments` object[]: An array of objects to send one or more attachments. This attachment object is assigned higher preference in case an API request is received with values for both the attachment objects.
      - `name` string: Name of the attachment. <br> e.g. invoice.pdf or statement.xls
      - `content` string: base64 encoded value of the attached file. <br>e.g if you want to attach a 'invoice.pdf' file, then convert the file content first in base64 and pass the value in this parameter.
    - `headers` object
  - `settings` object: An object parameter to configure the engagement tracking and scheduling.
    - `open_track` boolean: You can enable or disable open tracking for your emails.
    - `click_track` boolean: You can enable or disable click tracking for your emails.
    - `unsubscribe_track` boolean: You can enable or disable tracking of unsubscribe requests for your emails.
    - `ip_pool` string: The name of the pool. Example: "pool0", "pool1" etc. If you want to send the mail through the default IP of the account, pass the value as "default". If you want the mail through the shared pool, pass the value as "shared".
  - `bcc` object[]: An object to define the recipient information who is marked a blind carbon copy of the email
    - `email` string: Email address to be sent a blind carbon copy. Email delivery to this recipient is not affected if Bcc is provided in personalizations.
  - `schedule` integer: Indicate the time of email delivery using the Unix epoch time format. <br> Make sure to schedule your email within 72 hours from the time of request.

## Response `202`

Email sent successfully

- object
  - `data` object
    - `message_id` string
  - `message` string
  - `status` string

## Other responses

- `400`: Bad request
- `401`: Unauthorized
- `403`: Forbidden

---

[API](https://skmtc.dev/netcorecloud/apis/email-api-v5.md) - [All operations](https://skmtc.dev/netcorecloud/apis/email-api-v5/llms.txt) - [OpenAPI document](https://skmtc.dev/netcorecloud/apis/email-api-v5/revisions/7f81d8722ba3?raw)
