> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bizmail-delivery.bizfly.vn/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bizmail-delivery.bizfly.vn/_mcp/server.

# Send

POST https://api/1.0/mail/store
Content-Type: multipart/form-data

# BizMail API 1.0 — Send Mail

---

## 🇬🇧 English

> **Authentication required.** All requests must include a valid JWT access token obtained from `POST /api/1.0/auth/token`. 
  

---

### Send Mail

**`POST /api/1.0/mail/store`**

Send a transactional email. Supports plain text, HTML content, and file attachments.

#### Headers

| Key | Value | Required |
| --- | --- | --- |
| Authorization | Bearer | ✅ |
| Content-Type | multipart/form-data | ✅ |

#### Body (multipart/form-data)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| from | string | ✅ | Sender email address. Must be a valid email. Max 255 characters |
| from_name | string | ✅ | Sender display name. Max 255 characters |
| subject | string | ✅ | Email subject |
| to | string or string\[\] | ✅ | Recipient email address. Accepts a single email string or an array (`to[]`) |
| cc | string or string\[\] | ❌ | CC email address(es). Accepts a single email string or an array (`cc[]`) |
| bcc | string or string\[\] | ❌ | BCC email address(es). Accepts a single email string or an array (`bcc[]`) |
| text | string | ✅ \* | Plain text content. Required if `html` is not provided |
| html | string | ✅ \* | HTML content. Required if `text` is not provided |
| reply_to | string | ❌ | Reply-To email address |
| attachments / attachments\[\] | file | ❌ | File attachment(s). Total size must not exceed **20MB** |

> \* At least one of `text` or `html` must be provided. 
  

#### Example Request (JSON-style reference)

```
POST /api/1.0/mail/store
Authorization: Bearer <access_token>
Content-Type: multipart/form-data
from          = info@example.com
from_name     = My Company
subject       = Account Activation
to[]          = user@example.com
text          = Your account has been activated.
html          = <p class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27;>Your account has been activated.</p>
attachments[] = [file]

 ```

#### PHP (Guzzle) Example

``` php
$client = new Client();
$response = $client->post('https://smtp-api.bizfly.vn/api/1.0/mail/store', [
    'headers' => [
        &#x27;Authorization&#x27; => &#x27;Bearer <access_token>&#x27;,
    ],
    'multipart' => [
        ['name' => 'from',      'contents' => 'info@example.com'],
        ['name' => 'from_name', 'contents' => 'My Company'],
        ['name' => 'subject',   'contents' => 'Account Activation'],
        ['name' => 'to[]',      'contents' => 'user@example.com'],
        ['name' => 'text',      'contents' => 'Your account has been activated.'],
        [&#x27;name&#x27; => &#x27;html&#x27;,      &#x27;contents&#x27; => &#x27;<p class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27;>Your account has been activated.</p>&#x27;],
        [
            'name'     => 'attachments[]',
            'contents' => Utils::tryFopen('/path/to/file.pdf', 'r'),
            'filename' => 'file.pdf',
        ],
    ],
]);

 ```

#### Responses

**200 OK — Success**

``` json
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "550e8400-e29b-41d4-a716-446655440000@bizfly.vn"
}

 ```

| Field | Type | Description |
| --- | --- | --- |
| code | integer | HTTP status code |
| status | string | Result message |
| message_id | string | Unique ID of the queued email |

**400 Bad Request — Validation error**

``` json
{
  "errors": [
    {
      "msg": "Người gửi phải là email",
      "param": "from",
      "location": "body"
    }
  ]
}

 ```

**400 Bad Request — Attachment too large**

``` json
{
  "errors": [
    {
      "msg": "Tổng dung lượng file upload tối đa là 20Mb",
      "param": "attachments",
      "location": "files"
    }
  ]
}

 ```

**401 Unauthorized — Missing or invalid token**

``` json
{
  "success": false,
  "message": "Missing or invalid Authorization header"
}

 ```

**401 Unauthorized — Token expired**

``` json
{
  "success": false,
  "message": "Access token expired"
}

 ```

**500 Internal Server Error**

``` json
{
  "success": false,
  "message": "Internal server error"
}

 ```

---

---

## 🇻🇳 Tiếng Việt

> **Yêu cầu xác thực.** Tất cả request phải kèm JWT access token hợp lệ lấy từ `POST /api/1.0/auth/token`. 
  

---

### Gửi Mail

**`POST /api/1.0/mail/store`**

Gửi email giao dịch. Hỗ trợ nội dung text thuần, HTML và file đính kèm.

#### Headers

| Key | Value | Bắt buộc |
| --- | --- | --- |
| Authorization | Bearer | ✅ |
| Content-Type | multipart/form-data | ✅ |

#### Body (multipart/form-data)

| Tham số | Kiểu | Bắt buộc | Mô tả |
| --- | --- | --- | --- |
| from | string | ✅ | Email người gửi. Phải là email hợp lệ. Tối đa 255 ký tự |
| from_name | string | ✅ | Tên hiển thị người gửi. Tối đa 255 ký tự |
| subject | string | ✅ | Tiêu đề email |
| to | string hoặc string\[\] | ✅ | Email người nhận. Có thể là 1 email string hoặc mảng (`to[]`) |
| cc | string hoặc string\[\] | ❌ | Email CC. Có thể là 1 email string hoặc mảng (`cc[]`) |
| bcc | string hoặc string\[\] | ❌ | Email BCC. Có thể là 1 email string hoặc mảng (`bcc[]`) |
| text | string | ✅ \* | Nội dung dạng text thuần. Bắt buộc nếu không có `html` |
| html | string | ✅ \* | Nội dung dạng HTML. Bắt buộc nếu không có `text` |
| reply_to | string | ❌ | Địa chỉ email Reply-To |
| attachments / attachments\[\] | file | ❌ | File đính kèm. Tổng dung lượng không vượt quá **20MB** |

> \* Phải có ít nhất một trong `text` hoặc `html`. 
  

#### Ví dụ Request (dạng tham chiếu)

```
POST /api/1.0/mail/store
Authorization: Bearer <access_token>
Content-Type: multipart/form-data
from          = info@example.com
from_name     = Công ty của tôi
subject       = Kích hoạt tài khoản
to[]          = user@example.com
text          = Tài khoản của bạn đã được kích hoạt thành công.
html          = <p class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27;>Tài khoản của bạn đã được kích hoạt thành công.</p>
attachments[] = [file]

 ```

#### Ví dụ PHP (Guzzle)

``` php
$client = new Client();
$response = $client->post('https://smtp-api.bizfly.vn/api/1.0/mail/store', [
    'headers' => [
        &#x27;Authorization&#x27; => &#x27;Bearer <access_token>&#x27;,
    ],
    'multipart' => [
        ['name' => 'from',      'contents' => 'info@example.com'],
        ['name' => 'from_name', 'contents' => 'Công ty của tôi'],
        ['name' => 'subject',   'contents' => 'Kích hoạt tài khoản'],
        ['name' => 'to[]',      'contents' => 'user@example.com'],
        ['name' => 'text',      'contents' => 'Tài khoản của bạn đã được kích hoạt thành công.'],
        [&#x27;name&#x27; => &#x27;html&#x27;,      &#x27;contents&#x27; => &#x27;<p class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27;>Tài khoản của bạn đã được kích hoạt thành công.</p>&#x27;],
        [
            'name'     => 'attachments[]',
            'contents' => Utils::tryFopen('/path/to/file.pdf', 'r'),
            'filename' => 'file.pdf',
        ],
    ],
]);

 ```

#### Responses

**200 OK — Thành công**

``` json
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "550e8400-e29b-41d4-a716-446655440000@bizfly.vn"
}

 ```

| Trường | Kiểu | Mô tả |
| --- | --- | --- |
| code | integer | HTTP status code |
| status | string | Thông báo kết quả |
| message_id | string | ID duy nhất của email đã được đưa vào hàng đợi gửi |

**400 Bad Request — Lỗi validation**

``` json
{
  "errors": [
    {
      "msg": "Người gửi phải là email",
      "param": "from",
      "location": "body"
    }
  ]
}

 ```

**400 Bad Request — File đính kèm quá lớn**

``` json
{
  "errors": [
    {
      "msg": "Tổng dung lượng file upload tối đa là 20Mb",
      "param": "attachments",
      "location": "files"
    }
  ]
}

 ```

**401 Unauthorized — Thiếu hoặc sai token**

``` json
{
  "success": false,
  "message": "Missing or invalid Authorization header"
}

 ```

**401 Unauthorized — Token hết hạn**

``` json
{
  "success": false,
  "message": "Access token expired"
}

 ```

**500 Internal Server Error**

``` json
{
  "success": false,
  "message": "Internal server error"
}

 ```

Reference: https://docs.bizmail-delivery.bizfly.vn/biz-mail-delivery/mail/send

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: collection
  version: 1.0.0
paths:
  /api/1.0/mail/store:
    post:
      operationId: send
      summary: Send
      description: >-
        # BizMail API 1.0 — Send Mail


        ---


        ## 🇬🇧 English


        > **Authentication required.** All requests must include a valid JWT
        access token obtained from `POST /api/1.0/auth/token`. 
          

        ---


        ### Send Mail


        **`POST /api/1.0/mail/store`**


        Send a transactional email. Supports plain text, HTML content, and file
        attachments.


        #### Headers


        | Key | Value | Required |

        | --- | --- | --- |

        | Authorization | Bearer | ✅ |

        | Content-Type | multipart/form-data | ✅ |


        #### Body (multipart/form-data)


        | Field | Type | Required | Description |

        | --- | --- | --- | --- |

        | from | string | ✅ | Sender email address. Must be a valid email. Max
        255 characters |

        | from_name | string | ✅ | Sender display name. Max 255 characters |

        | subject | string | ✅ | Email subject |

        | to | string or string\[\] | ✅ | Recipient email address. Accepts a
        single email string or an array (`to[]`) |

        | cc | string or string\[\] | ❌ | CC email address(es). Accepts a single
        email string or an array (`cc[]`) |

        | bcc | string or string\[\] | ❌ | BCC email address(es). Accepts a
        single email string or an array (`bcc[]`) |

        | text | string | ✅ \* | Plain text content. Required if `html` is not
        provided |

        | html | string | ✅ \* | HTML content. Required if `text` is not
        provided |

        | reply_to | string | ❌ | Reply-To email address |

        | attachments / attachments\[\] | file | ❌ | File attachment(s). Total
        size must not exceed **20MB** |


        > \* At least one of `text` or `html` must be provided. 
          

        #### Example Request (JSON-style reference)


        ```

        POST /api/1.0/mail/store

        Authorization: Bearer <access_token>

        Content-Type: multipart/form-data

        from          = info@example.com

        from_name     = My Company

        subject       = Account Activation

        to[]          = user@example.com

        text          = Your account has been activated.

        html          = <p class=&#x27;preserveHtml&#x27;
        class=&#x27;preserveHtml&#x27;>Your account has been activated.</p>

        attachments[] = [file]

         ```

        #### PHP (Guzzle) Example


        ``` php

        $client = new Client();

        $response =
        $client->post('https://smtp-api.bizfly.vn/api/1.0/mail/store', [
            'headers' => [
                &#x27;Authorization&#x27; => &#x27;Bearer <access_token>&#x27;,
            ],
            'multipart' => [
                ['name' => 'from',      'contents' => 'info@example.com'],
                ['name' => 'from_name', 'contents' => 'My Company'],
                ['name' => 'subject',   'contents' => 'Account Activation'],
                ['name' => 'to[]',      'contents' => 'user@example.com'],
                ['name' => 'text',      'contents' => 'Your account has been activated.'],
                [&#x27;name&#x27; => &#x27;html&#x27;,      &#x27;contents&#x27; => &#x27;<p class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27;>Your account has been activated.</p>&#x27;],
                [
                    'name'     => 'attachments[]',
                    'contents' => Utils::tryFopen('/path/to/file.pdf', 'r'),
                    'filename' => 'file.pdf',
                ],
            ],
        ]);

         ```

        #### Responses


        **200 OK — Success**


        ``` json

        {
          "code": 200,
          "status": "Save mail success",
          "message_id": "550e8400-e29b-41d4-a716-446655440000@bizfly.vn"
        }

         ```

        | Field | Type | Description |

        | --- | --- | --- |

        | code | integer | HTTP status code |

        | status | string | Result message |

        | message_id | string | Unique ID of the queued email |


        **400 Bad Request — Validation error**


        ``` json

        {
          "errors": [
            {
              "msg": "Người gửi phải là email",
              "param": "from",
              "location": "body"
            }
          ]
        }

         ```

        **400 Bad Request — Attachment too large**


        ``` json

        {
          "errors": [
            {
              "msg": "Tổng dung lượng file upload tối đa là 20Mb",
              "param": "attachments",
              "location": "files"
            }
          ]
        }

         ```

        **401 Unauthorized — Missing or invalid token**


        ``` json

        {
          "success": false,
          "message": "Missing or invalid Authorization header"
        }

         ```

        **401 Unauthorized — Token expired**


        ``` json

        {
          "success": false,
          "message": "Access token expired"
        }

         ```

        **500 Internal Server Error**


        ``` json

        {
          "success": false,
          "message": "Internal server error"
        }

         ```

        ---


        ---


        ## 🇻🇳 Tiếng Việt


        > **Yêu cầu xác thực.** Tất cả request phải kèm JWT access token hợp lệ
        lấy từ `POST /api/1.0/auth/token`. 
          

        ---


        ### Gửi Mail


        **`POST /api/1.0/mail/store`**


        Gửi email giao dịch. Hỗ trợ nội dung text thuần, HTML và file đính kèm.


        #### Headers


        | Key | Value | Bắt buộc |

        | --- | --- | --- |

        | Authorization | Bearer | ✅ |

        | Content-Type | multipart/form-data | ✅ |


        #### Body (multipart/form-data)


        | Tham số | Kiểu | Bắt buộc | Mô tả |

        | --- | --- | --- | --- |

        | from | string | ✅ | Email người gửi. Phải là email hợp lệ. Tối đa 255
        ký tự |

        | from_name | string | ✅ | Tên hiển thị người gửi. Tối đa 255 ký tự |

        | subject | string | ✅ | Tiêu đề email |

        | to | string hoặc string\[\] | ✅ | Email người nhận. Có thể là 1 email
        string hoặc mảng (`to[]`) |

        | cc | string hoặc string\[\] | ❌ | Email CC. Có thể là 1 email string
        hoặc mảng (`cc[]`) |

        | bcc | string hoặc string\[\] | ❌ | Email BCC. Có thể là 1 email string
        hoặc mảng (`bcc[]`) |

        | text | string | ✅ \* | Nội dung dạng text thuần. Bắt buộc nếu không có
        `html` |

        | html | string | ✅ \* | Nội dung dạng HTML. Bắt buộc nếu không có
        `text` |

        | reply_to | string | ❌ | Địa chỉ email Reply-To |

        | attachments / attachments\[\] | file | ❌ | File đính kèm. Tổng dung
        lượng không vượt quá **20MB** |


        > \* Phải có ít nhất một trong `text` hoặc `html`. 
          

        #### Ví dụ Request (dạng tham chiếu)


        ```

        POST /api/1.0/mail/store

        Authorization: Bearer <access_token>

        Content-Type: multipart/form-data

        from          = info@example.com

        from_name     = Công ty của tôi

        subject       = Kích hoạt tài khoản

        to[]          = user@example.com

        text          = Tài khoản của bạn đã được kích hoạt thành công.

        html          = <p class=&#x27;preserveHtml&#x27;
        class=&#x27;preserveHtml&#x27;>Tài khoản của bạn đã được kích hoạt thành
        công.</p>

        attachments[] = [file]

         ```

        #### Ví dụ PHP (Guzzle)


        ``` php

        $client = new Client();

        $response =
        $client->post('https://smtp-api.bizfly.vn/api/1.0/mail/store', [
            'headers' => [
                &#x27;Authorization&#x27; => &#x27;Bearer <access_token>&#x27;,
            ],
            'multipart' => [
                ['name' => 'from',      'contents' => 'info@example.com'],
                ['name' => 'from_name', 'contents' => 'Công ty của tôi'],
                ['name' => 'subject',   'contents' => 'Kích hoạt tài khoản'],
                ['name' => 'to[]',      'contents' => 'user@example.com'],
                ['name' => 'text',      'contents' => 'Tài khoản của bạn đã được kích hoạt thành công.'],
                [&#x27;name&#x27; => &#x27;html&#x27;,      &#x27;contents&#x27; => &#x27;<p class=&#x27;preserveHtml&#x27; class=&#x27;preserveHtml&#x27;>Tài khoản của bạn đã được kích hoạt thành công.</p>&#x27;],
                [
                    'name'     => 'attachments[]',
                    'contents' => Utils::tryFopen('/path/to/file.pdf', 'r'),
                    'filename' => 'file.pdf',
                ],
            ],
        ]);

         ```

        #### Responses


        **200 OK — Thành công**


        ``` json

        {
          "code": 200,
          "status": "Save mail success",
          "message_id": "550e8400-e29b-41d4-a716-446655440000@bizfly.vn"
        }

         ```

        | Trường | Kiểu | Mô tả |

        | --- | --- | --- |

        | code | integer | HTTP status code |

        | status | string | Thông báo kết quả |

        | message_id | string | ID duy nhất của email đã được đưa vào hàng đợi
        gửi |


        **400 Bad Request — Lỗi validation**


        ``` json

        {
          "errors": [
            {
              "msg": "Người gửi phải là email",
              "param": "from",
              "location": "body"
            }
          ]
        }

         ```

        **400 Bad Request — File đính kèm quá lớn**


        ``` json

        {
          "errors": [
            {
              "msg": "Tổng dung lượng file upload tối đa là 20Mb",
              "param": "attachments",
              "location": "files"
            }
          ]
        }

         ```

        **401 Unauthorized — Thiếu hoặc sai token**


        ``` json

        {
          "success": false,
          "message": "Missing or invalid Authorization header"
        }

         ```

        **401 Unauthorized — Token hết hạn**


        ``` json

        {
          "success": false,
          "message": "Access token expired"
        }

         ```

        **500 Internal Server Error**


        ``` json

        {
          "success": false,
          "message": "Internal server error"
        }

         ```
      tags:
        - subpackage_mail
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mail_Send_Response_200'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PostApi1.0MailStoreRequestBadRequestError'
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                from:
                  type: string
                from_name:
                  type: string
                subject:
                  type: string
                to[]:
                  type: string
                text:
                  type: string
                html:
                  type: string
                attachments[]:
                  type: string
                  format: binary
              required:
                - from
                - from_name
                - subject
                - to[]
                - text
                - html
                - attachments[]
servers:
  - url: https:/
    description: https://{uri}
components:
  schemas:
    Mail_Send_Response_200:
      type: object
      properties:
        code:
          type: integer
        status:
          type: string
        message_id:
          type: string
          format: email
      required:
        - code
        - status
        - message_id
      title: Mail_Send_Response_200
    Api10MailStorePostResponsesContentApplicationJsonSchemaErrorsItems:
      type: object
      properties:
        msg:
          type: string
        param:
          type: string
        location:
          type: string
      required:
        - msg
        - param
        - location
      title: Api10MailStorePostResponsesContentApplicationJsonSchemaErrorsItems
    PostApi1.0MailStoreRequestBadRequestError:
      type: object
      properties:
        errors:
          type: array
          items:
            $ref: >-
              #/components/schemas/Api10MailStorePostResponsesContentApplicationJsonSchemaErrorsItems
      required:
        - errors
      title: PostApi1.0MailStoreRequestBadRequestError

```

## Examples



**Request**

```json
{
  "from": "string",
  "from_name": "string",
  "subject": "string",
  "to[]": "string",
  "text": "string",
  "html": "string",
  "attachments[]": "<file: string>"
}
```

**Response**

```json
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "bfe53336-5758-4e02-b44e-85e0d6df7ad0@bizfly.vn"
}
```

**SDK Code**

```python Mail_Send_example
import requests

url = "https://https/api/1.0/mail/store"

files = { "attachments[]": "open('string', 'rb')" }
payload = {
    "from": "string",
    "from_name": "string",
    "subject": "string",
    "to[]": "string",
    "text": "string",
    "html": "string"
}

response = requests.post(url, data=payload, files=files)

print(response.json())
```

```javascript Mail_Send_example
const url = 'https://https/api/1.0/mail/store';
const form = new FormData();
form.append('from', 'string');
form.append('from_name', 'string');
form.append('subject', 'string');
form.append('to[]', 'string');
form.append('text', 'string');
form.append('html', 'string');
form.append('attachments[]', 'string');

const options = {method: 'POST'};

options.body = form;

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Mail_Send_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://https/api/1.0/mail/store"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"from\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"from_name\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"subject\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"to[]\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"html\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments[]\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Mail_Send_example
require 'uri'
require 'net/http'

url = URI("https://https/api/1.0/mail/store")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"from\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"from_name\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"subject\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"to[]\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"html\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments[]\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
```

```java Mail_Send_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://https/api/1.0/mail/store")
  .body("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"from\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"from_name\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"subject\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"to[]\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"html\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments[]\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n")
  .asString();
```

```php Mail_Send_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://https/api/1.0/mail/store', [
  'multipart' => [
    [
        'name' => 'from',
        'contents' => 'string'
    ],
    [
        'name' => 'from_name',
        'contents' => 'string'
    ],
    [
        'name' => 'subject',
        'contents' => 'string'
    ],
    [
        'name' => 'to[]',
        'contents' => 'string'
    ],
    [
        'name' => 'text',
        'contents' => 'string'
    ],
    [
        'name' => 'html',
        'contents' => 'string'
    ],
    [
        'name' => 'attachments[]',
        'filename' => 'string',
        'contents' => null
    ]
  ]
]);

echo $response->getBody();
```

```csharp Mail_Send_example
using RestSharp;

var client = new RestClient("https://https/api/1.0/mail/store");
var request = new RestRequest(Method.POST);
request.AddParameter("undefined", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"from\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"from_name\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"subject\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"to[]\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"text\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"html\"\r\n\r\nstring\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"attachments[]\"; filename=\"string\"\r\nContent-Type: application/octet-stream\r\n\r\n\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Mail_Send_example
import Foundation
let parameters = [
  [
    "name": "from",
    "value": "string"
  ],
  [
    "name": "from_name",
    "value": "string"
  ],
  [
    "name": "subject",
    "value": "string"
  ],
  [
    "name": "to[]",
    "value": "string"
  ],
  [
    "name": "text",
    "value": "string"
  ],
  [
    "name": "html",
    "value": "string"
  ],
  [
    "name": "attachments[]",
    "fileName": "string"
  ]
]

let boundary = "---011000010111000001101001"

var body = ""
var error: NSError? = nil
for param in parameters {
  let paramName = param["name"]!
  body += "--\(boundary)\r\n"
  body += "Content-Disposition:form-data; name=\"\(paramName)\""
  if let filename = param["fileName"] {
    let contentType = param["content-type"]!
    let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)
    if (error != nil) {
      print(error as Any)
    }
    body += "; filename=\"\(filename)\"\r\n"
    body += "Content-Type: \(contentType)\r\n\r\n"
    body += fileContent
  } else if let paramValue = param["value"] {
    body += "\r\n\r\n\(paramValue)"
  }
}

let request = NSMutableURLRequest(url: NSURL(string: "https://https/api/1.0/mail/store")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```