> For the complete documentation index, see [llms.txt](https://user.netmera.com/netmera-developer-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://user.netmera.com/netmera-developer-guide/api-documentation/api-reference/email-and-sms/send-email-with-attachment.md). Agents can also search and read this documentation through its [MCP server](https://user.netmera.com/netmera-developer-guide/~gitbook/mcp).

# Send Email with Attachment

Sends an email with one or more file attachments, using an email notification key created in the panel. Submit the request as `multipart/form-data`.

#### How it works

Send the recipient in `to`, the definition in `notificationKey` and each file as a `mailAttachment` part. Any other form field fills a template placeholder: the field name is the placeholder and the field value its value.

<details>

<summary>Notes</summary>

* Each attachment file can be at most **1 MB**.
* The email, including its attachments, must not exceed **10 MB**.
* A larger attachment or request is rejected before it is processed, with HTTP 413 and an RFC 7807 body (`"detail": "Maximum upload size exceeded"`).
* The file type is detected from the file content, not from the file name.
* Supported file types:
  * **Images** — `image/png`, `image/x-png`, `image/x-citrix-png`, `image/gif`, `image/jpeg`, `image/x-citrix-jpeg`.
  * **Video** — `video/x-msvideo`, `video/mp4`, `video/mpeg`, `video/mpeg2`, `video/x-mpeg`.
  * **Text and spreadsheets** — `text/plain`, `text/csv`, `application/vnd.ms-excel`, `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`.
  * **Extensions** — `xlsx`, `xls`, `csv`, `txt`, `pdf`, `jpg`, `jpeg`, `png`, `gif`, `mpeg`, `mpeg-2`, `mp4`, `avi`.
* A request without `notificationKey` returns HTTP 400, code `2001`.
* A request without `to` is rejected. A request with an unknown `notificationKey` and an invalid `to` returns 200 with an empty JSON object.
* When `to` is a valid address that belongs to no user, the response is 200 with `{"notExist": "<address>"}`.

</details>

```json
{"openapi":"3.1.0","info":{"title":"Netmera REST API","version":"3.0"},"tags":[{"name":"Email and SMS","description":"Send email and SMS messages.\n\n<table data-view=\"cards\"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type=\"content-ref\"></th></tr></thead><tbody><tr><td><strong>Send Email or SMS</strong></td><td><code>POST</code> Send an email or an SMS to one user, with the content in the request or from a template.</td><td><a href=\"https://user.netmera.com/netmera-developer-guide/api-documentation/api-reference/email-and-sms/send-email-or-sms\">Send Email or SMS</a></td></tr><tr><td><strong>Send Email with Attachment</strong></td><td><code>POST</code> Send a panel email to one user with files attached.</td><td><a href=\"https://user.netmera.com/netmera-developer-guide/api-documentation/api-reference/email-and-sms/send-email-with-attachment\">Send Email with Attachment</a></td></tr><tr><td><strong>Send Bulk Email</strong></td><td><code>POST</code> Send a panel email template to an audience, filling its placeholders at send time.</td><td><a href=\"https://user.netmera.com/netmera-developer-guide/api-documentation/api-reference/email-and-sms/send-bulk-email\">Send Bulk Email</a></td></tr></tbody></table>\n"}],"servers":[{"url":"https://restapi.netmera.com","description":"Netmera REST API"}],"security":[{"REST-API-key":[]}],"components":{"securitySchemes":{"REST-API-key":{"type":"apiKey","in":"header","name":"X-netmera-api-key","description":"REST API key. Available in the Netmera Panel under Developers > API.\n"}},"schemas":{"NetmeraError":{"type":"object","description":"Standard Netmera error body.","required":["code","error"],"properties":{"code":{"type":"integer","description":"Netmera error code. See the error table in the API description."},"error":{"type":"string","description":"Human readable error message."}}},"ProblemDetail":{"type":"object","description":"RFC 7807 error body returned by the framework instead of the Netmera error body when a\nrequired query parameter is missing or a parameter cannot be converted to its type.\n","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"}}}}},"paths":{"/rest/3.0/sendEmailWithAttachment":{"post":{"operationId":"sendEmailWithAttachment","tags":["Email and SMS"],"summary":"Send Email with Attachment","description":"Sends an email with one or more file attachments, using an email notification key created in the\npanel. Submit the request as `multipart/form-data`.\n\n### How it works\n\nSend the recipient in `to`, the definition in `notificationKey` and each file as a `mailAttachment`\npart. Any other form field fills a template placeholder: the field name is the placeholder and the\nfield value its value.\n\n<details>\n\n<summary>Notes</summary>\n\n- Each attachment file can be at most **1 MB**.\n- The email, including its attachments, must not exceed **10 MB**.\n- A larger attachment or request is rejected before it is processed, with HTTP 413 and an RFC 7807\n  body (`\"detail\": \"Maximum upload size exceeded\"`).\n- The file type is detected from the file content, not from the file name.\n- Supported file types:\n  - **Images** — `image/png`, `image/x-png`, `image/x-citrix-png`, `image/gif`, `image/jpeg`,\n    `image/x-citrix-jpeg`.\n  - **Video** — `video/x-msvideo`, `video/mp4`, `video/mpeg`, `video/mpeg2`, `video/x-mpeg`.\n  - **Text and spreadsheets** — `text/plain`, `text/csv`, `application/vnd.ms-excel`,\n    `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`.\n  - **Extensions** — `xlsx`, `xls`, `csv`, `txt`, `pdf`, `jpg`, `jpeg`, `png`, `gif`, `mpeg`,\n    `mpeg-2`, `mp4`, `avi`.\n- A request without `notificationKey` returns HTTP 400, code `2001`.\n- A request without `to` is rejected. A request with an unknown `notificationKey` and an invalid\n  `to` returns 200 with an empty JSON object.\n- When `to` is a valid address that belongs to no user, the response is 200 with\n  `{\"notExist\": \"<address>\"}`.\n\n</details>\n","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"mailAttachment":{"type":"string","format":"binary","description":"The file to attach, at most 1 MB. More than one attachment may be added."},"to":{"type":"string","description":"Recipient email address."},"notificationKey":{"type":"string","description":"Notification key of the email definition created in the panel."}},"additionalProperties":{"type":"string","description":"Any other form field is passed to the email as a template parameter: the field\nname is the placeholder and the field value its value.\n"}}}}},"responses":{"200":{"description":"The email was accepted for delivery.","content":{"application/json":{"schema":{"type":"object","properties":{"notExist":{"type":"string","description":"Returned when no user has the `to` address; holds that address."}}}}}},"400":{"description":"Missing recipient.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetmeraError"}}}},"401":{"description":"Error responses the API can return.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetmeraError"}}}},"413":{"description":"An attachment is larger than 1 MB, or the request is larger than 10 MB.","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"500":{"description":"Error responses the API can return.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetmeraError"}}}}}}}}}
```


---

# 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://user.netmera.com/netmera-developer-guide/api-documentation/api-reference/email-and-sms/send-email-with-attachment.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.
