---
title: "Mail.MultipartMessage"
description: "Multipart mail message prototype."
canonical_url: "https://www.zeyos.com/zymba/ref/mail/mail-multipartmessage"
markdown_url: "https://www.zeyos.com/ai/guide/zymba/ref/mail/mail-multipartmessage.md"
section: "zymba-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/zymbaref.json"
source_sha256: "05a361c6ddc32e74f4a6dc16fd06f218210ff1b7ce57f26ca1994bfffc407915"
---

# Mail.MultipartMessage

## Mail.MultipartMessage

```
object @Mail.MultipartMessage(@Mail.Message) {
	construct() {}
	addPart(@Mail.Message $message): $this {}
	attach(string $string, string $filename, string $type): object {}
	attachFile(string $path, ?string $filename, string $type): object {}
	clearParts(): $this {}
	countParts(): int {}
	getBoundary(): string {}
	listParts(): object {}
	removePart(@Mail.Message $message): $this {}
	setBoundary(string $boundary): $this {}
}
```

**Multipart mail message prototype.**

### Prototype

**[Mail.Message](#)**

## Methods


### `$this.construct()`


```code
$this.construct(): void
```




### `$this.addPart()`


```code
$this.addPart(@Mail.Message $message): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| message | `@Mail.Message`  |  | null |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.attach()`


```code
$this.attach(string $string, string $filename, string $type): @Mail.SimpleMessage
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| string | `string`  |  | "" |
| filename | `string`  |  | "" |
| type | `string`  |  | "application/octet-stream" |

##### Returns

| Type | Value |
| --- | ---  |
| `@Mail.SimpleMessage` |  |




### `$this.attachFile()`


```code
$this.attachFile(string $path, ?string $filename, string $type): @Mail.SimpleMessage
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| path | `string`  |  | "" |
| filename | `?string`  |  | derived from path |
| type | `string`  |  | "application/octet-stream" |

##### Returns

| Type | Value |
| --- | ---  |
| `@Mail.SimpleMessage` |  |




### `$this.clearParts()`


```code
$this.clearParts(): this
```

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.countParts()`


```code
$this.countParts(): int
```

##### Returns

| Type | Value |
| --- | ---  |
| `int` |  |




### `$this.getBoundary()`


Gets the boundary delimiter of this message.

```code
$this.getBoundary(): string
```

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |




### `$this.listParts()`


```code
$this.listParts(): object
```

##### Returns

| Type | Value |
| --- | ---  |
| `object` | [message, ...] |




### `$this.removePart()`


```code
$this.removePart(@Mail.Message $message): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| message | `@Mail.Message`  |  | null |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |




### `$this.setBoundary()`


Sets the boundary delimiter of this message.

```code
$this.setBoundary(string $boundary): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| boundary | `string`  |  | "" |

##### Returns

| Type | Value |
| --- | ---  |
| `$this` |  |
