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

# Mail.Message

## Mail.Message

```
object @Mail.Message(@Base) {
	clearHeaders(): $this {}
	countHeaders(): int {}
	create(): string {}
	getDisposition(): string {}
	getFilename(): string {}
	getHeader(string $name): string {}
	getTransferEncoding(): string {}
	getType(): string {}
	isAttachment(): bool {}
	listHeaderNames(): object {}
	listHeaders(): object {}
	removeHeader(string $name): $this {}
	removeHeaders(object $names): $this {}
	setHeader(string $name, mixed $value): $this {}
	setHeaders(object $headers, string $prefix): $this {}
	setDisposition(string $disposition, string $filename): $this {}
	setTransferEncoding(string $encoding): $this {}
	setType(string $type): $this {}
}
```

**Abstract mail message prototype.**

### Prototype

**[Base](#)**

## Methods


### `$this.clearHeaders()`


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

##### Returns

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




### `$this.countHeaders()`


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

##### Returns

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




### `$this.create()`


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

##### Returns

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




### `$this.getDisposition()`


Gets the content disposition of this message.

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

##### Returns

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




### `$this.getFilename()`


Gets the filename of this message.

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

##### Returns

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




### `$this.getHeader()`


```code
$this.getHeader(string $name): string
```

##### Parameters

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

##### Returns

| Type | Value |
| --- | ---  |
| `string` |  |
| `object` | [value, ...] |
| `null` |  |




### `$this.getTransferEncoding()`


Gets the content transfer encoding of this message.

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

##### Returns

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




### `$this.getType()`


Gets the content type of this message.

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

##### Returns

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




### `$this.isAttachment()`


```code
$this.isAttachment(): bool
```

##### Returns

| Type | Value |
| --- | ---  |
| `bool` |  |




### `$this.listHeaderNames()`


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

##### Returns

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




### `$this.listHeaders()`


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

##### Returns

| Type | Value |
| --- | ---  |
| `object` | [name: value, ...] |




### `$this.removeHeader()`


```code
$this.removeHeader(string $name): this
```

##### Parameters

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

##### Returns

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




### `$this.removeHeaders()`


```code
$this.removeHeaders(object $names): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| names | `object`  | [name, ...] | [] |

##### Returns

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




### `$this.setHeader()`


Sets a mail header.

```code
$this.setHeader(string $name, mixed $value): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| name | `string`  |  | "" |
| value | `mixed`  |  | null |

##### Returns

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




### `$this.setHeaders()`


Sets multiple mail headers by treating slot names as header names, expanded by a specific prefix, and slot values as non-referential header values.

```code
$this.setHeaders(object $headers, string $prefix): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| headers | `object`  | [name: value, ...] | [] |
| prefix | `string`  |  | "" |

##### Returns

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




### `$this.setDisposition()`


Sets the content disposition of this message.

```code
$this.setDisposition(string $disposition, string $filename): this
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| disposition | `string`  |  | "" |
| filename | `string`  |  | "" |

##### Returns

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




### `$this.setTransferEncoding()`


Sets the content transfer encoding of this message.

```code
$this.setTransferEncoding(string $encoding): this
```

##### Parameters

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

##### Returns

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




### `$this.setType()`


Sets the content type of this message.

```code
$this.setType(string $type): this
```

##### Parameters

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

##### Returns

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