> For the complete documentation index, see [llms.txt](https://postman-v1.guides.gov.sg/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://postman-v1.guides.gov.sg/email-api-guide/programmatic-email-api/send-email-api/attachments.md).

# Attachments

{% hint style="warning" %}
**Updated Nov 2026: The Postman Legacy Team will not be providing support for our email API until further notice.**

**Set-up is fully self-service:** Our endpoints remain open, so you may continue to integrate with them if it is sufficient for your use case.

* However, if you experience any issues, we will not be able to provide any support due to limited resources.
* Onboarding to custom from-email addresses and attachments for API is not available.
  {% endhint %}

Our programmatic email API supports attachments via [`multipart/form-data` requests](https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2).

## Overview

* The attachment feature is only available to users who have [set up sending emails from their own domains](https://postman-v1.guides.gov.sg/email-api-guide/programmatic-email-api/custom-from-address.md). If your agency would like to set this up, [contact us](https://go.gov.sg/postman-contact-us).
* Each email can have up to 10 attachments.
* Each attachment should not exceed 2MB in size.
* The cumulative size of all attachments should not exceed 10MB.
* You can find the list of supported attachment file types below.

You will receive a `413` error if the requirements above are not met.

### Supported attachment file types

<details>

<summary><strong>List of supported attachment file types</strong></summary>

* `asc`
* `avi`
* `bmp`
* `csv`
* `dgn`
* `docx`
* `dwf`
* `dwg`
* `dxf`
* `ent`
* `gif`
* `jpeg`
* `jpg`
* `mpeg`
* `mpg`
* `mpp`
* `odb`
* `odf`
* `odg`
* `ods`
* `pdf`
* `png`
* `pptx`
* `rtf`
* `sxc`
* `sxd`
* `sxi`
* `sxw`
* `tif`
* `tiff`
* `txt`
* `wmv`
* `xlsx`

</details>

## Sample API calls

### API call with one attachment

```zsh
curl --location --request POST 'https://api.postman.gov.sg/v1/transactional/email/send' \
--header 'Authorization: Bearer your_api_key' \
--form 'body="<p>Hello <b>there</b></p>"' \
--form 'recipient="recipient@agency.gov.sg"' \
--form 'attachments=@"/your/local/path-to-file"' \
--form 'subject="Test email"'
--form 'from="user@agency.gov.sg"'
```

### API call with two attachments

```zsh
curl --location --request POST 'https://api.postman.gov.sg/v1/transactional/email/send' \
--header 'Authorization: Bearer your_api_key' \
--form 'body="<p>Hello <b>there</b></p>"' \
--form 'recipient="recipient@agency.gov.sg"' \
--form 'attachments=@"/your/local/path-to-file-1"' \
--form 'attachments=@"/your/local/path-to-file-2"' \
--form 'subject="Test email"'
--form 'from="user@agency.gov.sg"'
```

## Sample code

### JavaScript

```
const data = new FormData();
data.append("recipient", "recipient@agency.gov.sg");
data.append("subject", "Test email");
data.append("body", "<p>Hello <b>there</b></p>");
data.append("from", "user@agency.gov.sg");
data.append("attachments", "/your/local/path-to-file-1");
data.append("attachments", "/your/local/path-to-file-2");

const xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://api.postman.gov.sg/v1/transactional/email/send");
xhr.setRequestHeader("Authorization", "Bearer your_api_key");

xhr.send(data);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://postman-v1.guides.gov.sg/email-api-guide/programmatic-email-api/send-email-api/attachments.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
