---
title: "MIME"
description: "Static MIME related functions."
canonical_url: "https://www.zeyos.com/zymba/ref/mime"
markdown_url: "https://www.zeyos.com/ai/guide/zymba/ref/mime.md"
section: "zymba-reference"
authority: "reference"
language: "en"
source_repository: "https://cloud.zeyos.com/__doc/zymbaref.json"
source_sha256: "05a361c6ddc32e74f4a6dc16fd06f218210ff1b7ce57f26ca1994bfffc407915"
---

# MIME

## MIME

```
object @MIME() {
	createMultipart(object $parts, string $boundary, string $preamble, string $epilog): string {}
	fromBase64(string $string): string {}
	fromBase64URL(string $string): string {}
	fromEncodedWord(string $string): string {}
	fromQuotedPrintable(string $string): string {}
	isPrintable(string $string): bool {}
	parseMultipart(string $body, ?string $boundary): object {}
	toBase64(string $string): string {}
	toBase64Raw(string $string): string {}
	toBase64URL(string $string): string {}
	toEncodedWord(string $string): string {}
	toQuotedPrintable(string $string): string {}
}
```

**Static MIME related functions.**

## Functions


### `@MIME.createMultipart()`


```code
@MIME.createMultipart(object $parts, string $boundary, string $preamble, string $epilog): string
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| parts | `object`  |  | [] |
| boundary | `string`  |  | "" |
| preamble | `string`  |  | "" |
| epilog | `string`  |  | "" |

##### Returns

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




### `@MIME.fromBase64()`


Decodes a string according to RFC 2045 by converting printable characters back to arbitrary byte sequences.

```code
@MIME.fromBase64(string $string): string
```

##### Parameters

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

##### Returns

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




### `@MIME.fromBase64URL()`


Decodes a string according to RFC 2045 by converting printable characters back to arbitrary byte sequences, but using an URL and filename safe alphabet as per RFC 4648.

```code
@MIME.fromBase64URL(string $string): string
```

##### Parameters

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

##### Returns

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




### `@MIME.fromEncodedWord()`


```code
@MIME.fromEncodedWord(string $string): string
```

##### Parameters

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

##### Returns

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




### `@MIME.fromQuotedPrintable()`


Decodes a string according to RFC 2045 by replacing sequences incipient with an equal sign ("=") followed by a 2-character hexadecimal number with their applicable characters.

```code
@MIME.fromQuotedPrintable(string $string): string
```

##### Parameters

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

##### Returns

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




### `@MIME.isPrintable()`


```code
@MIME.isPrintable(string $string): bool
```

##### Parameters

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

##### Returns

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




### `@MIME.parseMultipart()`


```code
@MIME.parseMultipart(string $body, ?string $boundary): object
```

##### Parameters

| Name | Type | Value | Default |
| --- | --- | --- | --- |
| body | `string`  |  | "" |
| boundary | `?string`  |  | detect |

##### Returns

| Type | Value |
| --- | ---  |
| `object` | [part, ...] |
| `null` |  |




### `@MIME.toBase64()`


Encodes a string in lines of no more than 76 bytes according to RFC 2045 using a 65-character printable subset of US-ASCII to represent arbitrary byte sequences.

```code
@MIME.toBase64(string $string): string
```

##### Parameters

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

##### Returns

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




### `@MIME.toBase64Raw()`


Encodes a string without line breaks according to RFC 2045 using a 65-character printable subset of US-ASCII to represent arbitrary byte sequences.

```code
@MIME.toBase64Raw(string $string): string
```

##### Parameters

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

##### Returns

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




### `@MIME.toBase64URL()`


Encodes a string without line breaks according to RFC 2045 using a 65-character printable subset of US-ASCII to represent arbitrary byte sequences, but using an URL and filename safe alphabet as per RFC 4648.

```code
@MIME.toBase64URL(string $string): string
```

##### Parameters

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

##### Returns

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




### `@MIME.toEncodedWord()`


```code
@MIME.toEncodedWord(string $string): string
```

##### Parameters

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

##### Returns

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




### `@MIME.toQuotedPrintable()`


Encodes a string in lines of no more than 76 bytes according to RFC 2045 by replacing every unprintable character with an equal sign ("=") followed by a 2-character hexadecimal number.

```code
@MIME.toQuotedPrintable(string $string): string
```

##### Parameters

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

##### Returns

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