> 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.

# Introduction

# BizMail Delivery API — Overview

***

## 🇬🇧 English

### Introduction

BizMail provides two methods to send transactional emails from your application:

1. **REST API** — Send emails via HTTP requests using JWT authentication
2. **SMTP** — Send emails via standard SMTP protocol using your BizMail Portal credentials

All credentials (username, password) are managed through the **BizMail Portal**.

***

### REST API

Base URL: `https://smtp-api.bizfly.vn`

#### Authentication Flow

BizMail API uses **JWT (JSON Web Token)** for authentication.

```javascript
1. Call POST /api/1.0/auth/token  →  get access_token (1 day) + refresh_token (90 days)
2. Attach access_token to every API request:
       Authorization: Bearer <access_token>
3. When access_token expires → call POST /api/1.0/auth/refresh to get a new pair
4. When refresh_token expires → repeat step 1

```

```python
1. Call POST /api/1.0/auth/token  →  get access_token (1 day) + refresh_token (90 days)
2. Attach access_token to every API request:
       Authorization: Bearer <access_token>
3. When access_token expires → call POST /api/1.0/auth/refresh to get a new pair
4. When refresh_token expires → repeat step 1

```

```java
1. Call POST /api/1.0/auth/token  →  get access_token (1 day) + refresh_token (90 days)
2. Attach access_token to every API request:
       Authorization: Bearer <access_token>
3. When access_token expires → call POST /api/1.0/auth/refresh to get a new pair
4. When refresh_token expires → repeat step 1

```

```curl
1. Call POST /api/1.0/auth/token  →  get access_token (1 day) + refresh_token (90 days)
2. Attach access_token to every API request:
       Authorization: Bearer <access_token>
3. When access_token expires → call POST /api/1.0/auth/refresh to get a new pair
4. When refresh_token expires → repeat step 1

```

```bash
1. Call POST /api/1.0/auth/token  →  get access_token (1 day) + refresh_token (90 days)
2. Attach access_token to every API request:
       Authorization: Bearer <access_token>
3. When access_token expires → call POST /api/1.0/auth/refresh to get a new pair
4. When refresh_token expires → repeat step 1

```

#### Endpoints

| Method | Endpoint                | Auth         | Description                              |
| ------ | ----------------------- | ------------ | ---------------------------------------- |
| POST   | `/api/1.0/auth/token`   | ❌            | Get access token & refresh token         |
| POST   | `/api/1.0/auth/refresh` | ❌            | Refresh access token using refresh token |
| POST   | `/api/1.0/mail/store`   | ✅ Bearer JWT | Send a transactional email               |

***

#### 1. Auth — Get Token

`POST /api/1.0/auth/token`

Obtain a JWT access token and refresh token using credentials from BizMail Portal.

**Request Body (JSON):**

| Field    | Type   | Required | Description                  |
| -------- | ------ | -------- | ---------------------------- |
| username | string | ✅        | Username from BizMail Portal |
| password | string | ✅        | Password from BizMail Portal |

**Response:**

```javascript
{
  "success": true,
  "access_token": "<jwt_access_token>",
  "refresh_token": "<jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```python
{
  "success": true,
  "access_token": "<jwt_access_token>",
  "refresh_token": "<jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```java
{
  "success": true,
  "access_token": "<jwt_access_token>",
  "refresh_token": "<jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```curl
{
  "success": true,
  "access_token": "<jwt_access_token>",
  "refresh_token": "<jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```bash
{
  "success": true,
  "access_token": "<jwt_access_token>",
  "refresh_token": "<jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

***

#### 2. Auth — Refresh Token

`POST /api/1.0/auth/refresh`

Get a new access token and refresh token using an existing refresh token.

**Request Body (JSON):**

| Field          | Type   | Required | Description                      |
| -------------- | ------ | -------- | -------------------------------- |
| refresh\_token | string | ✅        | Refresh token from `/auth/token` |

**Response:**

```javascript
{
  "success": true,
  "access_token": "<new_jwt_access_token>",
  "refresh_token": "<new_jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```python
{
  "success": true,
  "access_token": "<new_jwt_access_token>",
  "refresh_token": "<new_jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```java
{
  "success": true,
  "access_token": "<new_jwt_access_token>",
  "refresh_token": "<new_jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```curl
{
  "success": true,
  "access_token": "<new_jwt_access_token>",
  "refresh_token": "<new_jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```bash
{
  "success": true,
  "access_token": "<new_jwt_access_token>",
  "refresh_token": "<new_jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

***

#### 3. Send Mail

`POST /api/1.0/mail/store`

Send a transactional email with optional attachments.

**Headers:** `Authorization: Bearer` , `Content-Type: multipart/form-data`

**Key Fields:**

| Field          | Required | Description                       |
| -------------- | -------- | --------------------------------- |
| from           | ✅        | Sender email                      |
| from\_name     | ✅        | Sender display name               |
| subject        | ✅        | Email subject                     |
| to / to\[]     | ✅        | Recipient(s)                      |
| cc / cc\[]     | ❌        | CC recipient(s)                   |
| bcc / bcc\[]   | ❌        | BCC recipient(s)                  |
| text           | ✅ \*     | Plain text body                   |
| html           | ✅ \*     | HTML body                         |
| attachments\[] | ❌        | File attachments (max 20MB total) |

> \* At least one of `text` or `html` is required.

**Response:**

```javascript
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "uuid@bizfly.vn"
}

```

```python
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "uuid@bizfly.vn"
}

```

```java
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "uuid@bizfly.vn"
}

```

```curl
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "uuid@bizfly.vn"
}

```

```bash
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "uuid@bizfly.vn"
}

```

***

#### 4. Webhook — Mail Tracking

BizMail pushes real-time delivery events to your configured webhook URL set in the BizMail Portal.

**Trigger events:**

| Event       | Description                                                                                      |
| ----------- | ------------------------------------------------------------------------------------------------ |
| `delivered` | Email was successfully delivered to the recipient's inbox                                        |
| `bounced`   | Email bounced — can be hard bounce (invalid address) or soft bounce (temporary server rejection) |
| `dropped`   | Email was dropped by the server                                                                  |

> Configure your webhook URL in the **BizMail Portal** under your account settings. See the [Webhook Tracking document](https://docs.bizmail-delivery.bizfly.vn/biz-mail-delivery/mail/web-hook) for full payload details.

> Configure your webhook URL in the **BizMail Portal** under your account settings.

***

### SMTP

For applications that support SMTP natively (e.g. Laravel Mail, PHPMailer, Nodemailer), you can send emails directly via BizMail's SMTP server.

#### SMTP Configuration

| Setting    | Value                             |
| ---------- | --------------------------------- |
| Host       | `smtp-api.bizfly.vn`              |
| Port (TLS) | `2525`                            |
| Port (SSL) | `2465`                            |
| Username   | Your username from BizMail Portal |
| Password   | Your password from BizMail Portal |
| Encryption | TLS (port 2525) / SSL (port 2465) |

#### Example — Laravel (`.env`)

```javascript
MAIL_MAILER=smtp
MAIL_HOST=smtp-api.bizfly.vn
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@yourdomain.com
MAIL_FROM_NAME="Your Company"

```

```python
MAIL_MAILER=smtp
MAIL_HOST=smtp-api.bizfly.vn
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@yourdomain.com
MAIL_FROM_NAME="Your Company"

```

```java
MAIL_MAILER=smtp
MAIL_HOST=smtp-api.bizfly.vn
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@yourdomain.com
MAIL_FROM_NAME="Your Company"

```

```curl
MAIL_MAILER=smtp
MAIL_HOST=smtp-api.bizfly.vn
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@yourdomain.com
MAIL_FROM_NAME="Your Company"

```

```bash
MAIL_MAILER=smtp
MAIL_HOST=smtp-api.bizfly.vn
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@yourdomain.com
MAIL_FROM_NAME="Your Company"

```

#### Example — PHPMailer

```javascript
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'smtp-api.bizfly.vn';
$mail->SMTPAuth   = true;
$mail->Username   = 'your_username';
$mail->Password   = 'your_password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 2525;

```

```python
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'smtp-api.bizfly.vn';
$mail->SMTPAuth   = true;
$mail->Username   = 'your_username';
$mail->Password   = 'your_password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 2525;

```

```java
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'smtp-api.bizfly.vn';
$mail->SMTPAuth   = true;
$mail->Username   = 'your_username';
$mail->Password   = 'your_password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 2525;

```

```curl
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'smtp-api.bizfly.vn';
$mail->SMTPAuth   = true;
$mail->Username   = 'your_username';
$mail->Password   = 'your_password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 2525;

```

```bash
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'smtp-api.bizfly.vn';
$mail->SMTPAuth   = true;
$mail->Username   = 'your_username';
$mail->Password   = 'your_password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 2525;

```

#### Example — Nodemailer

```javascript
const transporter = nodemailer.createTransport({
  host: 'smtp-api.bizfly.vn',
  port: 2525,
  secure: false,
  auth: {
    user: 'your_username',
    pass: 'your_password',
  },
});

```

```python
const transporter = nodemailer.createTransport({
  host: 'smtp-api.bizfly.vn',
  port: 2525,
  secure: false,
  auth: {
    user: 'your_username',
    pass: 'your_password',
  },
});

```

```java
const transporter = nodemailer.createTransport({
  host: 'smtp-api.bizfly.vn',
  port: 2525,
  secure: false,
  auth: {
    user: 'your_username',
    pass: 'your_password',
  },
});

```

```curl
const transporter = nodemailer.createTransport({
  host: 'smtp-api.bizfly.vn',
  port: 2525,
  secure: false,
  auth: {
    user: 'your_username',
    pass: 'your_password',
  },
});

```

```bash
const transporter = nodemailer.createTransport({
  host: 'smtp-api.bizfly.vn',
  port: 2525,
  secure: false,
  auth: {
    user: 'your_username',
    pass: 'your_password',
  },
});

```

***

***

## 🇻🇳 Tiếng Việt

### Giới thiệu

BizMail cung cấp hai phương thức gửi email giao dịch từ ứng dụng của bạn:

1. **REST API** — Gửi email qua HTTP request sử dụng xác thực JWT
2. **SMTP** — Gửi email qua giao thức SMTP chuẩn sử dụng thông tin đăng nhập từ BizMail Portal

Tất cả thông tin đăng nhập (username, password) được quản lý qua **BizMail Portal**.

***

### REST API

Base URL: `https://smtp-api.bizfly.vn`

#### Luồng xác thực

BizMail API sử dụng **JWT (JSON Web Token)** để xác thực.

```javascript
1. Gọi POST /api/1.0/auth/token  →  nhận access_token (1 ngày) + refresh_token (90 ngày)
2. Gắn access_token vào mọi API request:
       Authorization: Bearer <access_token>
3. Khi access_token hết hạn → gọi POST /api/1.0/auth/refresh để lấy cặp token mới
4. Khi refresh_token hết hạn → lặp lại bước 1

```

```python
1. Gọi POST /api/1.0/auth/token  →  nhận access_token (1 ngày) + refresh_token (90 ngày)
2. Gắn access_token vào mọi API request:
       Authorization: Bearer <access_token>
3. Khi access_token hết hạn → gọi POST /api/1.0/auth/refresh để lấy cặp token mới
4. Khi refresh_token hết hạn → lặp lại bước 1

```

```java
1. Gọi POST /api/1.0/auth/token  →  nhận access_token (1 ngày) + refresh_token (90 ngày)
2. Gắn access_token vào mọi API request:
       Authorization: Bearer <access_token>
3. Khi access_token hết hạn → gọi POST /api/1.0/auth/refresh để lấy cặp token mới
4. Khi refresh_token hết hạn → lặp lại bước 1

```

```curl
1. Gọi POST /api/1.0/auth/token  →  nhận access_token (1 ngày) + refresh_token (90 ngày)
2. Gắn access_token vào mọi API request:
       Authorization: Bearer <access_token>
3. Khi access_token hết hạn → gọi POST /api/1.0/auth/refresh để lấy cặp token mới
4. Khi refresh_token hết hạn → lặp lại bước 1

```

```bash
1. Gọi POST /api/1.0/auth/token  →  nhận access_token (1 ngày) + refresh_token (90 ngày)
2. Gắn access_token vào mọi API request:
       Authorization: Bearer <access_token>
3. Khi access_token hết hạn → gọi POST /api/1.0/auth/refresh để lấy cặp token mới
4. Khi refresh_token hết hạn → lặp lại bước 1

```

#### Danh sách Endpoint

| Method | Endpoint                | Auth         | Mô tả                                   |
| ------ | ----------------------- | ------------ | --------------------------------------- |
| POST   | `/api/1.0/auth/token`   | ❌            | Lấy access token & refresh token        |
| POST   | `/api/1.0/auth/refresh` | ❌            | Làm mới access token bằng refresh token |
| POST   | `/api/1.0/mail/store`   | ✅ Bearer JWT | Gửi email giao dịch                     |

***

#### 1. Auth — Lấy Token

`POST /api/1.0/auth/token`

Lấy JWT access token và refresh token từ thông tin đăng nhập trên BizMail Portal.

**Request Body (JSON):**

| Tham số  | Kiểu   | Bắt buộc | Mô tả                      |
| -------- | ------ | -------- | -------------------------- |
| username | string | ✅        | Username từ BizMail Portal |
| password | string | ✅        | Password từ BizMail Portal |

**Response:**

```javascript
{
  "success": true,
  "access_token": "<jwt_access_token>",
  "refresh_token": "<jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```python
{
  "success": true,
  "access_token": "<jwt_access_token>",
  "refresh_token": "<jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```java
{
  "success": true,
  "access_token": "<jwt_access_token>",
  "refresh_token": "<jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```curl
{
  "success": true,
  "access_token": "<jwt_access_token>",
  "refresh_token": "<jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```bash
{
  "success": true,
  "access_token": "<jwt_access_token>",
  "refresh_token": "<jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

***

#### 2. Auth — Refresh Token

`POST /api/1.0/auth/refresh`

Lấy access token và refresh token mới từ refresh token hiện có.

**Request Body (JSON):**

| Tham số        | Kiểu   | Bắt buộc | Mô tả                               |
| -------------- | ------ | -------- | ----------------------------------- |
| refresh\_token | string | ✅        | Refresh token nhận từ `/auth/token` |

**Response:**

```javascript
{
  "success": true,
  "access_token": "<new_jwt_access_token>",
  "refresh_token": "<new_jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```python
{
  "success": true,
  "access_token": "<new_jwt_access_token>",
  "refresh_token": "<new_jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```java
{
  "success": true,
  "access_token": "<new_jwt_access_token>",
  "refresh_token": "<new_jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```curl
{
  "success": true,
  "access_token": "<new_jwt_access_token>",
  "refresh_token": "<new_jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

```bash
{
  "success": true,
  "access_token": "<new_jwt_access_token>",
  "refresh_token": "<new_jwt_refresh_token>",
  "token_type": "Bearer",
  "expires_in": 86400
}

```

***

#### 3. Gửi Mail

`POST /api/1.0/mail/store`

Gửi email giao dịch, hỗ trợ file đính kèm.

**Headers:** `Authorization: Bearer` , `Content-Type: multipart/form-data`

**Các tham số chính:**

| Tham số        | Bắt buộc | Mô tả                            |
| -------------- | -------- | -------------------------------- |
| from           | ✅        | Email người gửi                  |
| from\_name     | ✅        | Tên hiển thị người gửi           |
| subject        | ✅        | Tiêu đề email                    |
| to / to\[]     | ✅        | Email người nhận (1 hoặc nhiều)  |
| cc / cc\[]     | ❌        | Email CC (1 hoặc nhiều)          |
| bcc / bcc\[]   | ❌        | Email BCC (1 hoặc nhiều)         |
| text           | ✅ \*     | Nội dung text thuần              |
| html           | ✅ \*     | Nội dung HTML                    |
| attachments\[] | ❌        | File đính kèm (tổng tối đa 20MB) |

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

**Response:**

```javascript
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "uuid@bizfly.vn"
}

```

```python
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "uuid@bizfly.vn"
}

```

```java
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "uuid@bizfly.vn"
}

```

```curl
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "uuid@bizfly.vn"
}

```

```bash
{
  "code": 200,
  "status": "Save mail success",
  "message_id": "uuid@bizfly.vn"
}

```

***

#### 4. Webhook — Tracking Mail

BizMail gửi các sự kiện tracking theo thời gian thực đến webhook URL được cấu hình trong BizMail Portal.

**Các sự kiện:**

| Sự kiện     | Mô tả                                                                                                      |
| ----------- | ---------------------------------------------------------------------------------------------------------- |
| `delivered` | Email đã được gửi thành công vào hộp thư của người nhận                                                    |
| `bounced`   | Email bị bounce — có thể là hard bounce (địa chỉ không tồn tại) hoặc soft bounce (server từ chối tạm thời) |
| `dropped`   | Email bị hủy trước khi gửi                                                                                 |

> Cấu hình webhook URL trong **BizMail Portal** tại phần cài đặt tài khoản. Xem chi tiết payload tại [tài liệu Webhook Tracking](https://api-1.0-webhook.md).

***

### SMTP

Dành cho các ứng dụng hỗ trợ SMTP gốc (Laravel Mail, PHPMailer, Nodemailer...), bạn có thể gửi email trực tiếp qua SMTP server của BizMail.

#### Thông tin cấu hình SMTP

| Thông số   | Giá trị                           |
| ---------- | --------------------------------- |
| Host       | `smtp-api.bizfly.vn`              |
| Port (TLS) | `2525`                            |
| Port (SSL) | `2465`                            |
| Username   | Username từ BizMail Portal        |
| Password   | Password từ BizMail Portal        |
| Mã hoá     | TLS (port 2525) / SSL (port 2465) |

#### Ví dụ — Laravel (`.env`)

```javascript
MAIL_MAILER=smtp
MAIL_HOST=smtp-api.bizfly.vn
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@yourdomain.com
MAIL_FROM_NAME="Tên công ty"

```

```python
MAIL_MAILER=smtp
MAIL_HOST=smtp-api.bizfly.vn
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@yourdomain.com
MAIL_FROM_NAME="Tên công ty"

```

```java
MAIL_MAILER=smtp
MAIL_HOST=smtp-api.bizfly.vn
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@yourdomain.com
MAIL_FROM_NAME="Tên công ty"

```

```curl
MAIL_MAILER=smtp
MAIL_HOST=smtp-api.bizfly.vn
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@yourdomain.com
MAIL_FROM_NAME="Tên công ty"

```

```bash
MAIL_MAILER=smtp
MAIL_HOST=smtp-api.bizfly.vn
MAIL_PORT=2525
MAIL_USERNAME=your_username
MAIL_PASSWORD=your_password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=info@yourdomain.com
MAIL_FROM_NAME="Tên công ty"

```

#### Ví dụ — PHPMailer

```javascript
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'smtp-api.bizfly.vn';
$mail->SMTPAuth   = true;
$mail->Username   = 'your_username';
$mail->Password   = 'your_password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 2525;

```

```python
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'smtp-api.bizfly.vn';
$mail->SMTPAuth   = true;
$mail->Username   = 'your_username';
$mail->Password   = 'your_password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 2525;

```

```java
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'smtp-api.bizfly.vn';
$mail->SMTPAuth   = true;
$mail->Username   = 'your_username';
$mail->Password   = 'your_password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 2525;

```

```curl
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'smtp-api.bizfly.vn';
$mail->SMTPAuth   = true;
$mail->Username   = 'your_username';
$mail->Password   = 'your_password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 2525;

```

```bash
$mail = new PHPMailer(true);
$mail->isSMTP();
$mail->Host       = 'smtp-api.bizfly.vn';
$mail->SMTPAuth   = true;
$mail->Username   = 'your_username';
$mail->Password   = 'your_password';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port       = 2525;

```

#### Ví dụ — Nodemailer

```javascript
const transporter = nodemailer.createTransport({
  host: 'smtp-api.bizfly.vn',
  port: 2525,
  secure: false,
  auth: {
    user: 'your_username',
    pass: 'your_password',
  },
});

```

```python
const transporter = nodemailer.createTransport({
  host: 'smtp-api.bizfly.vn',
  port: 2525,
  secure: false,
  auth: {
    user: 'your_username',
    pass: 'your_password',
  },
});

```

```java
const transporter = nodemailer.createTransport({
  host: 'smtp-api.bizfly.vn',
  port: 2525,
  secure: false,
  auth: {
    user: 'your_username',
    pass: 'your_password',
  },
});

```

```curl
const transporter = nodemailer.createTransport({
  host: 'smtp-api.bizfly.vn',
  port: 2525,
  secure: false,
  auth: {
    user: 'your_username',
    pass: 'your_password',
  },
});

```

```bash
const transporter = nodemailer.createTransport({
  host: 'smtp-api.bizfly.vn',
  port: 2525,
  secure: false,
  auth: {
    user: 'your_username',
    pass: 'your_password',
  },
});

```