# MIME Class

The MIME class allows for the simple encoding and decoding of MIME structures, such as message attachments and file uploads.

## Class Name

**IPWorksPGP_MIME**

## Procedural Interface

```text
 ipworkspgp_mime_open();
 ipworkspgp_mime_close($res);
 ipworkspgp_mime_register_callback($res, $id, $function);
 ipworkspgp_mime_get_last_error($res);
 ipworkspgp_mime_get_last_error_code($res);
 ipworkspgp_mime_set($res, $id, $index, $value);
 ipworkspgp_mime_get($res, $id, $index);
 ipworkspgp_mime_do_config($res, $configurationstring);
 ipworkspgp_mime_do_decodefromfile($res);
 ipworkspgp_mime_do_decodefromstring($res);
 ipworkspgp_mime_do_decodepart($res, $index);
 ipworkspgp_mime_do_decodeparttofile($res, $index);
 ipworkspgp_mime_do_encodetofile($res);
 ipworkspgp_mime_do_encodetostring($res);
 ipworkspgp_mime_do_reset($res);
 ipworkspgp_mime_do_resetdata($res);
```

## Remarks

The class may be used for decoding or encoding of messages. [Message](#message-property-ipworkspgp_mime-class) holds the content of the encoded message or the filename that holds the encoded data. The decoded data are provided in Parts properties.

To decode a MIME message, you should first assign either the whole message (headers and body) to [Message](#message-property-ipworkspgp_mime-class) or put the message headers into the MessageHeaders property and the message body or the filename holding it into the [Message](#message-property-ipworkspgp_mime-class) property. Calling [DecodeFromFile](#decodefromfile-method-ipworkspgp_mime-class) or [DecodeFromString](#decodefromstring-method-ipworkspgp_mime-class) directs the class to start parsing the message: it will fill out the [ContentType](#contenttype-property-ipworkspgp_mime-class) and [ContentTypeAttr](#contenttypeattr-property-ipworkspgp_mime-class) properties with message content-type information, and it will enter information about message parts into the Parts properties, which includes part sizes, part content types, part content type attributes, part content disposition, part content disposition attributes, part encoding, part name, part filename, part headers, or part content (part-decoded string or part-decoded file) for each decoded part.

Calling the [DecodeFromString](#decodefromstring-method-ipworkspgp_mime-class) or [DecodeFromFile](#decodefromfile-method-ipworkspgp_mime-class) to decode does not actually decode the message but only parses it. The real decoding is done when the part content in the Parts properties is first accessed.

To encode data into a MIME message, you should first assign values for each part to either a part-decoded string or a part- decoded file in the Parts properties property, and optionally assign values to the other part attributes in the Parts properties. Assigning a value to the part-decoded string or a part-decoded file through the Parts properties, fills out automatically the part headers into the Parts properties for the respective part. Calling [EncodeToFile](#encodetofile-method-ipworkspgp_mime-class) or [EncodeToString](#encodetostring-method-ipworkspgp_mime-class) directs the class to fill out the [Message](#message-property-ipworkspgp_mime-class) with the message body and the MessageHeaders with the headers.

The [Progress](#progress-event-ipworkspgp_mime-class) event is fired as the message is parsed and the data are decoded/encoded.

## Property List

*The following is the full list of the properties of the class with short descriptions. Click on the links for further details.*

|  |  |
| --- | --- |
| [Boundary](#boundary-property-ipworkspgp_mime-class) | This property includes the boundary separating the MIME parts. It has a maximum length of 80 bytes. |
| [ContentType](#contenttype-property-ipworkspgp_mime-class) | This property includes the value of the content-type header of the message that was encoded/decoded. |
| [ContentTypeAttr](#contenttypeattr-property-ipworkspgp_mime-class) | This property includes the attributes of the content-type header of the message that was encoded or decoded. |
| [Message](#message-property-ipworkspgp_mime-class) | This property contains the encoded message text or a path to a file that contains the encoded message text. |
| [MessageHeaderCount](#messageheadercount-property-ipworkspgp_mime-class) | The number of records in the MessageHeader arrays. |
| [MessageHeaderField](#messageheaderfield-property-ipworkspgp_mime-class) | This property contains the name of the HTTP header (this is the same case as it is delivered). |
| [MessageHeaderValue](#messageheadervalue-property-ipworkspgp_mime-class) | This property contains the header contents. |
| [MessageHeadersString](#messageheadersstring-property-ipworkspgp_mime-class) | This property includes the string version of the MIME message headers. |
| [PartCount](#partcount-property-ipworkspgp_mime-class) | The number of records in the Part arrays. |
| [PartContentDisposition](#partcontentdisposition-property-ipworkspgp_mime-class) | This property contains content disposition for each part. |
| [PartContentDispositionAttr](#partcontentdispositionattr-property-ipworkspgp_mime-class) | This property contains the content disposition's attribute (if any) for each part. |
| [PartContentId](#partcontentid-property-ipworkspgp_mime-class) | This property contains the content identifier for each part. |
| [PartContentType](#partcontenttype-property-ipworkspgp_mime-class) | This property contains the content type for each part. |
| [PartContentTypeAttr](#partcontenttypeattr-property-ipworkspgp_mime-class) | This property contains the content-type attribute, if any, for each part. |
| [PartDecodedFile](#partdecodedfile-property-ipworkspgp_mime-class) | This property may be set to a file on disk before calling EncodeToString , EncodeToFile or EncodeToStream . |
| [PartDecodedString](#partdecodedstring-property-ipworkspgp_mime-class) | This property holds the actual content of each part. |
| [PartEncoding](#partencoding-property-ipworkspgp_mime-class) | This property contains the actual content encoding type for each part. |
| [PartFileName](#partfilename-property-ipworkspgp_mime-class) | This property contains the filename attribute specified in the headers of the part. |
| [PartHeaders](#partheaders-property-ipworkspgp_mime-class) | This property contains the headers for each MIME part. |
| [PartName](#partname-property-ipworkspgp_mime-class) | This property contains the name given to a part, such as the filename. |
| [PartSize](#partsize-property-ipworkspgp_mime-class) | This property contains the size of the DecodedFile or DecodedString . |

## Method List

*The following is the full list of the methods of the class with short descriptions. Click on the links for further details.*

|  |  |
| --- | --- |
| [Config](#config-method-ipworkspgp_mime-class) | Sets or retrieves a configuration setting. |
| [DecodeFromFile](#decodefromfile-method-ipworkspgp_mime-class) | This method decodes from a file. |
| [DecodeFromString](#decodefromstring-method-ipworkspgp_mime-class) | This method decodes from a string. |
| [DecodePart](#decodepart-method-ipworkspgp_mime-class) | This method decodes the specified part. |
| [DecodePartToFile](#decodeparttofile-method-ipworkspgp_mime-class) | This method decodes the specified part to a file on disk. |
| [EncodeToFile](#encodetofile-method-ipworkspgp_mime-class) | This method encodes to a file. |
| [EncodeToString](#encodetostring-method-ipworkspgp_mime-class) | This method encodes to a string. |
| [Reset](#reset-method-ipworkspgp_mime-class) | This method will reset the class. |
| [ResetData](#resetdata-method-ipworkspgp_mime-class) | This method resets the values of all headers and part properties. |

## Event List

*The following is the full list of the events fired by the class with short descriptions. Click on the links for further details.*

|  |  |
| --- | --- |
| [Error](#error-event-ipworkspgp_mime-class) | Fired when information is available about errors during data delivery. |
| [Header](#header-event-ipworkspgp_mime-class) | This event is fired every time a header is parsed. |
| [Progress](#progress-event-ipworkspgp_mime-class) | This event shows the progress of decoding or encoding the input data. |

## Config Settings

*The following is a list of config settings for the class with short descriptions. Click on the links for further details.*

|  |  |
| --- | --- |
| [DecodeMessageHeaders](#DecodeMessageHeaders) | Instructs the class to automatically decode message headers. |
| [IncludeHeaders](#IncludeHeaders) | Tells the class whether to include the headers when encoding the message. |
| [RequireVersionHeader](#RequireVersionHeader) | Specifies whether or not the class should require the version header. |
| [SanitizeFileName](#SanitizeFileName) | Whether invalid characters are replaced in MIME part filenames. |
| [TempFilePath](#TempFilePath) | If set, the temporary files created during MIME decoding and encoding will be put in the path specified. |
| [BuildInfo](#BuildInfo) | Information about the product's build. |
| [CodePage](#CodePage) | The system code page used for Unicode to Multibyte translations. |
| [LicenseInfo](#LicenseInfo) | Information about the current license. |
| [MaskSensitiveData](#MaskSensitiveData) | Whether sensitive data is masked in log messages. |
| [ProcessIdleEvents](#ProcessIdleEvents) | Whether the class uses its internal event loop to process events when the main thread is idle. |
| [SelectWaitMillis](#SelectWaitMillis) | The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process. |
| [UseFIPSCompliantAPI](#UseFIPSCompliantAPI) | Tells the class whether or not to use FIPS certified APIs. |
| [UseInternalSecurityAPI](#UseInternalSecurityAPI) | Whether or not to use the system security libraries or an internal implementation. |

# Boundary Property ([IPWorksPGP_MIME](#mime-class) Class)

This property includes the boundary separating the MIME parts. It has a maximum length of 80 bytes.

## Object Oriented Interface

```text
public function getBoundary();
public function setBoundary($value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 1 );
ipworkspgp_mime_set($res, 1, $value );
```

## Default Value

''

## Remarks

This property contains the boundary separating the MIME parts and has a maximum length of 80 bytes. The class automatically generates a random boundary value during encoding, if no value is given. During decoding, this property is filled with the boundary from the actual MIME message.

The class will truncate any string longer than 80 bytes if assigned to Boundary.

## Data Type

String

# ContentType Property ([IPWorksPGP_MIME](#mime-class) Class)

This property includes the value of the content-type header of the message that was encoded/decoded.

## Object Oriented Interface

```text
public function getContentType();
public function setContentType($value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 2 );
ipworkspgp_mime_set($res, 2, $value );
```

## Default Value

''

## Remarks

This property contains the value of the content-type header of the message that was encoded/decoded. The class filters it out from the MessageHeaders. It shows the user information about the type of the parts and their relation to each other.

The content-type attributes, such as filename, boundary, and charset, are held in this property.

## Data Type

String

# ContentTypeAttr Property ([IPWorksPGP_MIME](#mime-class) Class)

This property includes the attributes of the content-type header of the message that was encoded or decoded.

## Object Oriented Interface

```text
public function getContentTypeAttr();
public function setContentTypeAttr($value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 3 );
ipworkspgp_mime_set($res, 3, $value );
```

## Default Value

''

## Remarks

This property contains content-type attributes such as "filename", "boundary", and "charset".

## Data Type

String

# Message Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains the encoded message text or a path to a file that contains the encoded message text.

## Object Oriented Interface

```text
public function getMessage();
public function setMessage($value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 4 );
ipworkspgp_mime_set($res, 4, $value );
```

## Default Value

''

## Remarks

This property contains the encoded message text or a path to a file that contains the encoded message text. The class fills out this property with the message body and MessageHeaders during encoding. The user may assign both the headers and the body to this property and leave MessageHeaders empty before decoding.

This property is not available at design time.

## Data Type

Binary String

# MessageHeaderCount Property ([IPWorksPGP_MIME](#mime-class) Class)

The number of records in the MessageHeader arrays.

## Object Oriented Interface

```text
public function getMessageHeaderCount();
public function setMessageHeaderCount($value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 5 );
ipworkspgp_mime_set($res, 5, $value );
```

## Default Value

0

## Remarks

This property controls the size of the following arrays:

- [MessageHeaderField](#messageheaderfield-property-ipworkspgp_mime-class)
- [MessageHeaderValue](#messageheadervalue-property-ipworkspgp_mime-class)

The array indices start at *0* and end at *MessageHeaderCount - 1*.

This property is not available at design time.

## Data Type

Integer

# MessageHeaderField Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains the name of the HTTP header (this is the same case as it is delivered).

## Object Oriented Interface

```text
public function getMessageHeaderField($messageheaderindex);
public function setMessageHeaderField($messageheaderindex, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 6 , $messageheaderindex);
ipworkspgp_mime_set($res, 6, $value , $messageheaderindex);
```

## Default Value

''

## Remarks

This property contains the name of the HTTP [Header](#Type_Header) (this is the same case as it is delivered).

The *$messageheaderindex* parameter specifies the index of the item in the array. The size of the array is controlled by the [MessageHeaderCount](#messageheadercount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

String

# MessageHeaderValue Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains the header contents.

## Object Oriented Interface

```text
public function getMessageHeaderValue($messageheaderindex);
public function setMessageHeaderValue($messageheaderindex, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 7 , $messageheaderindex);
ipworkspgp_mime_set($res, 7, $value , $messageheaderindex);
```

## Default Value

''

## Remarks

This property contains the [Header](#Type_Header) contents.

The *$messageheaderindex* parameter specifies the index of the item in the array. The size of the array is controlled by the [MessageHeaderCount](#messageheadercount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

String

# MessageHeadersString Property ([IPWorksPGP_MIME](#mime-class) Class)

This property includes the string version of the MIME message headers.

## Object Oriented Interface

```text
public function getMessageHeadersString();
public function setMessageHeadersString($value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 8 );
ipworkspgp_mime_set($res, 8, $value );
```

## Default Value

''

## Remarks

The component fills out MessageHeadersString upon encoding. The user should use these strings as additional headers when emailing the [Message](#message-property-ipworkspgp_mime-class).

This property contains a string version of the MIME message headers. During decoding, if this property is empty, the class will try to find the headers in the beginning of the [Message](#message-property-ipworkspgp_mime-class) and will fill out this property accordingly.

## Data Type

String

# PartCount Property ([IPWorksPGP_MIME](#mime-class) Class)

The number of records in the Part arrays.

## Object Oriented Interface

```text
public function getPartCount();
public function setPartCount($value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 9 );
ipworkspgp_mime_set($res, 9, $value );
```

## Default Value

0

## Remarks

This property controls the size of the following arrays:

- [PartContentDisposition](#partcontentdisposition-property-ipworkspgp_mime-class)
- [PartContentDispositionAttr](#partcontentdispositionattr-property-ipworkspgp_mime-class)
- [PartContentId](#partcontentid-property-ipworkspgp_mime-class)
- [PartContentType](#partcontenttype-property-ipworkspgp_mime-class)
- [PartContentTypeAttr](#partcontenttypeattr-property-ipworkspgp_mime-class)
- [PartDecodedFile](#partdecodedfile-property-ipworkspgp_mime-class)
- [PartDecodedString](#partdecodedstring-property-ipworkspgp_mime-class)
- [PartEncoding](#partencoding-property-ipworkspgp_mime-class)
- [PartFileName](#partfilename-property-ipworkspgp_mime-class)
- [PartHeaders](#partheaders-property-ipworkspgp_mime-class)
- [PartName](#partname-property-ipworkspgp_mime-class)
- [PartSize](#partsize-property-ipworkspgp_mime-class)

The array indices start at *0* and end at *PartCount - 1*.

This property is not available at design time.

## Data Type

Integer

# PartContentDisposition Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains content disposition for each part.

## Object Oriented Interface

```text
public function getPartContentDisposition($partidx);
public function setPartContentDisposition($partidx, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 10 , $partidx);
ipworkspgp_mime_set($res, 10, $value , $partidx);
```

## Default Value

''

## Remarks

This property contains content disposition for each part.

The value in this property is used in the *Content-Disposition* header. Typical values include "form-data" and "attachment". The class fills it out each time the [PartDecodedFile](#partdecodedfile-property-ipworkspgp_mime-class) is changed. Changing the [PartContentDisposition](#partcontentdisposition-property-ipworkspgp_mime-class) recalculates the [PartHeaders](#partheaders-property-ipworkspgp_mime-class) as well.

The *$partidx* parameter specifies the index of the item in the array. The size of the array is controlled by the [PartCount](#partcount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

String

# PartContentDispositionAttr Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains the content disposition's attribute (if any) for each part.

## Object Oriented Interface

```text
public function getPartContentDispositionAttr($partidx);
public function setPartContentDispositionAttr($partidx, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 11 , $partidx);
ipworkspgp_mime_set($res, 11, $value , $partidx);
```

## Default Value

''

## Remarks

This property contains the content disposition's attribute (if any) for each part.

Typical values for this property are the names of the form-variables used while creating an HTTP post or the values for filenames.

Setting this property recalculates the [PartHeaders](#partheaders-property-ipworkspgp_mime-class).

The *$partidx* parameter specifies the index of the item in the array. The size of the array is controlled by the [PartCount](#partcount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

String

# PartContentId Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains the content identifier for each part.

## Object Oriented Interface

```text
public function getPartContentId($partidx);
public function setPartContentId($partidx, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 12 , $partidx);
ipworkspgp_mime_set($res, 12, $value , $partidx);
```

## Default Value

''

## Remarks

This property contains the content identifier for each part. The value of this property is used in the *Content-Id* header. The class fills it out each time the [PartDecodedFile](#partdecodedfile-property-ipworkspgp_mime-class) is changed. Changing this property recalculates the [PartHeaders](#partheaders-property-ipworkspgp_mime-class) as well.

The *$partidx* parameter specifies the index of the item in the array. The size of the array is controlled by the [PartCount](#partcount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

String

# PartContentType Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains the content type for each part.

## Object Oriented Interface

```text
public function getPartContentType($partidx);
public function setPartContentType($partidx, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 13 , $partidx);
ipworkspgp_mime_set($res, 13, $value , $partidx);
```

## Default Value

''

## Remarks

This property contains the content type for each part. The value of this property is used in the *Content-Type* header. Typical values include "image/gif" and "text/plain". The class fills it out each time the [PartDecodedFile](#partdecodedfile-property-ipworkspgp_mime-class) is changed. Changing this property recalculates the [PartHeaders](#partheaders-property-ipworkspgp_mime-class) as well.

The *$partidx* parameter specifies the index of the item in the array. The size of the array is controlled by the [PartCount](#partcount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

String

# PartContentTypeAttr Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains the content-type attribute, if any, for each part.

## Object Oriented Interface

```text
public function getPartContentTypeAttr($partidx);
public function setPartContentTypeAttr($partidx, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 14 , $partidx);
ipworkspgp_mime_set($res, 14, $value , $partidx);
```

## Default Value

''

## Remarks

This property contains the content-type attribute, if any, for each part. Setting this recalculates the [PartHeaders](#partheaders-property-ipworkspgp_mime-class) as well.

The *$partidx* parameter specifies the index of the item in the array. The size of the array is controlled by the [PartCount](#partcount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

String

# PartDecodedFile Property ([IPWorksPGP_MIME](#mime-class) Class)

This property may be set to a file on disk before calling EncodeToString , EncodeToFile or EncodeToStream .

## Object Oriented Interface

```text
public function getPartDecodedFile($partidx);
public function setPartDecodedFile($partidx, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 15 , $partidx);
ipworkspgp_mime_set($res, 15, $value , $partidx);
```

## Default Value

''

## Remarks

This property may be set to a file on disk before calling [EncodeToString](#encodetostring-method-ipworkspgp_mime-class), [EncodeToFile](#encodetofile-method-ipworkspgp_mime-class) or [EncodeToStream](#MIME_m_EncodeToStream). When encoding, data for the part will be read from the specified file.

When decoding, call [DecodePartToFile](#decodeparttofile-method-ipworkspgp_mime-class) to decode a specific part to a file on disk.

The *$partidx* parameter specifies the index of the item in the array. The size of the array is controlled by the [PartCount](#partcount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

String

# PartDecodedString Property ([IPWorksPGP_MIME](#mime-class) Class)

This property holds the actual content of each part.

## Object Oriented Interface

```text
public function getPartDecodedString($partidx);
public function setPartDecodedString($partidx, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 16 , $partidx);
ipworkspgp_mime_set($res, 16, $value , $partidx);
```

## Default Value

''

## Remarks

This property holds the actual content of each part. The class decodes the actual part of [Message](#message-property-ipworkspgp_mime-class) to [PartDecodedString](#partdecodedstring-property-ipworkspgp_mime-class) when [PartDecodedString](#partdecodedstring-property-ipworkspgp_mime-class)'s value is first queried.

Setting a value to [PartDecodedString](#partdecodedstring-property-ipworkspgp_mime-class) fills out the corresponding [PartSize](#partsize-property-ipworkspgp_mime-class) with the string size if the corresponding [PartDecodedFile](#partdecodedfile-property-ipworkspgp_mime-class) is empty.

The class checks during encoding first [PartDecodedFile](#partdecodedfile-property-ipworkspgp_mime-class): if it is empty, then the class uses the value of [PartDecodedString](#partdecodedstring-property-ipworkspgp_mime-class).

NOTE: It is recommended to use the [DecodePart](#decodepart-method-ipworkspgp_mime-class) method instead of querying this property.

The *$partidx* parameter specifies the index of the item in the array. The size of the array is controlled by the [PartCount](#partcount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

Binary String

# PartEncoding Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains the actual content encoding type for each part.

## Object Oriented Interface

```text
public function getPartEncoding($partidx);
public function setPartEncoding($partidx, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 17 , $partidx);
ipworkspgp_mime_set($res, 17, $value , $partidx);
```

## Possible Values

```text
MIME_PARTENCODING_7BIT(0), MIME_PARTENCODING_QUOTED_PRINTABLE(1), MIME_PARTENCODING_BASE_64(2), MIME_PARTENCODING_8BIT(3), MIME_PARTENCODING_BINARY(4), MIME_PARTENCODING_UUENCODE(5)
```

## Default Value

0

## Remarks

This property contains the actual content encoding type for each part. This property determines how to encode the data or how they actually were encoded in the [Message](#message-property-ipworkspgp_mime-class), as specified in the *Content-Transfer-Encoding* header.

Possible values for the this property are as follows:

|  |  |
| --- | --- |
| pe7bit (0) | 7 Bit data, no encoding. |
| peQuotedPrintable (1) | Quoted-Printable encoding of (typically) text. |
| peBase64 (2) | Base64 encoding of binary data. |
| pe8Bit (3) | No encoding, 8-bit characters may be contained as well. |
| peBinary (4) | Binary data without any encoding. Similar to 3 (8-bit encoding). |
| peUUEncode (5) | Uuencoding of binary data. |

The *$partidx* parameter specifies the index of the item in the array. The size of the array is controlled by the [PartCount](#partcount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

Integer

# PartFileName Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains the filename attribute specified in the headers of the part.

## Object Oriented Interface

```text
public function getPartFileName($partidx);
public function setPartFileName($partidx, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 18 , $partidx);
ipworkspgp_mime_set($res, 18, $value , $partidx);
```

## Default Value

''

## Remarks

This property contains the filename attribute specified in the headers of the part. Changing the value of the corresponding [PartDecodedFile](#partdecodedfile-property-ipworkspgp_mime-class) automatically sets the [PartFileName](#partfilename-property-ipworkspgp_mime-class) and consequently the [PartHeaders](#partheaders-property-ipworkspgp_mime-class).

The *$partidx* parameter specifies the index of the item in the array. The size of the array is controlled by the [PartCount](#partcount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

String

# PartHeaders Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains the headers for each MIME part.

## Object Oriented Interface

```text
public function getPartHeaders($partidx);
public function setPartHeaders($partidx, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 19 , $partidx);
ipworkspgp_mime_set($res, 19, $value , $partidx);
```

## Default Value

''

## Remarks

This property contains the headers for each MIME part. The class fills out this property each time any of the other corresponding part properties are changed. If additional headers are needed, they should be appended after all of the other corresponding part properties are set.

The *$partidx* parameter specifies the index of the item in the array. The size of the array is controlled by the [PartCount](#partcount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

String

# PartName Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains the name given to a part, such as the filename.

## Object Oriented Interface

```text
public function getPartName($partidx);
public function setPartName($partidx, $value);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 20 , $partidx);
ipworkspgp_mime_set($res, 20, $value , $partidx);
```

## Default Value

''

## Remarks

This property contains the name given to a part, such as the filename. Changing the value of [PartDecodedFile](#partdecodedfile-property-ipworkspgp_mime-class) automatically sets the corresponding [PartName](#partname-property-ipworkspgp_mime-class) and consequently the [PartHeaders](#partheaders-property-ipworkspgp_mime-class).

The *$partidx* parameter specifies the index of the item in the array. The size of the array is controlled by the [PartCount](#partcount-property-ipworkspgp_mime-class) property.

This property is not available at design time.

## Data Type

String

# PartSize Property ([IPWorksPGP_MIME](#mime-class) Class)

This property contains the size of the DecodedFile or DecodedString .

## Object Oriented Interface

```text
public function getPartSize($partidx);
```

## Procedural Interface

```text
ipworkspgp_mime_get($res, 22 , $partidx);
```

## Default Value

0

## Remarks

This property contains the size of the [PartDecodedFile](#partdecodedfile-property-ipworkspgp_mime-class) or [PartDecodedString](#partdecodedstring-property-ipworkspgp_mime-class). If a non-empty value is assigned to [PartDecodedFile](#partdecodedfile-property-ipworkspgp_mime-class), then class fills out the corresponding [PartSize](#partsize-property-ipworkspgp_mime-class) with the file size; if the file does not exist, an error occurs.

If the [PartDecodedFile](#partdecodedfile-property-ipworkspgp_mime-class) is empty and a value is assigned to [PartDecodedString](#partdecodedstring-property-ipworkspgp_mime-class), then the corresponding [PartSize](#partsize-property-ipworkspgp_mime-class) will be equal to the string's size.

During decoding, this property is filled with the size of that part.

The *$partidx* parameter specifies the index of the item in the array. The size of the array is controlled by the [PartCount](#partcount-property-ipworkspgp_mime-class) property.

This property is read-only and not available at design time.

## Data Type

Integer

# Config Method ([IPWorksPGP_MIME](#mime-class) Class)

Sets or retrieves a configuration setting.

## Object Oriented Interface

```text
public function doConfig($configurationstring);
```

## Procedural Interface

```text
ipworkspgp_mime_do_config($res, $configurationstring);
```

## Remarks

Config is a generic method available in every class. It is used to set and retrieve [configuration settings](#config-settings-mime-class) for the class.

These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these *internal properties* is provided through the Config method.

To set a configuration setting named *PROPERTY*, you must call *Config("PROPERTY=VALUE")*, where *VALUE* is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).

To read (query) the value of a [configuration setting](#config-settings-mime-class), you must call *Config("PROPERTY")*. The value will be returned as a string.

# DecodeFromFile Method ([IPWorksPGP_MIME](#mime-class) Class)

This method decodes from a file.

## Object Oriented Interface

```text
public function doDecodeFromFile();
```

## Procedural Interface

```text
ipworkspgp_mime_do_decodefromfile($res);
```

## Remarks

This method decodes the data file given in [Message](#message-property-ipworkspgp_mime-class) and optionally MessageHeaders and fills out the Parts properties for each decoded part.

**Example. Decoding from a File:**

```text
MIMEControl.Message = "C:\filename.txt"
MIMEControl.DecodeFromFile
```

In this example, *C:\filename.txt* must contain the MIME headers and body. If not, the MessageHeaders property must be set to the appropriate MIME headers.

# DecodeFromString Method ([IPWorksPGP_MIME](#mime-class) Class)

This method decodes from a string.

## Object Oriented Interface

```text
public function doDecodeFromString();
```

## Procedural Interface

```text
ipworkspgp_mime_do_decodefromstring($res);
```

## Remarks

This method decodes from a string. It is the same as DecodeFromFile, but now the [Message](#message-property-ipworkspgp_mime-class) denotes the real encoded message rather than a filename.

This method decodes the data given in [Message](#message-property-ipworkspgp_mime-class) and optionally MessageHeaders and fills out the Parts properties.

**Example. Decoding a Mail Message:**

```text
MIMEControl.MessageHeadersString = MailControl.MessageHeaders
MIMEControl.Message = MailControl.MessageText
MIMEControl.DecodeFromString
```

# DecodePart Method ([IPWorksPGP_MIME](#mime-class) Class)

This method decodes the specified part.

## Object Oriented Interface

```text
public function doDecodePart($index);
```

## Procedural Interface

```text
ipworkspgp_mime_do_decodepart($res, $index);
```

## Remarks

This method decodes the part specified by *index* and returns the decoded part data.

[DecodeFromString](#decodefromstring-method-ipworkspgp_mime-class) or [DecodeFromFile](#decodefromfile-method-ipworkspgp_mime-class) must be called before calling this method. Calling this method will return the decoded bytes, and in addition, the [PartDecodedString](#partdecodedstring-property-ipworkspgp_mime-class) property will be populated with the string representation of the decoded data.

**Example. Decoding a Specified Part:**

```csharp
mime.MessageHeadersString = myMessageHeaders;
mime.Message = myMessageBody;
mime.DecodeFromString();

byte[] myPartContent = await mime.DecodePart(0);
```

# DecodePartToFile Method ([IPWorksPGP_MIME](#mime-class) Class)

This method decodes the specified part to a file on disk.

## Object Oriented Interface

```text
public function doDecodePartToFile($index);
```

## Procedural Interface

```text
ipworkspgp_mime_do_decodeparttofile($res, $index);
```

## Remarks

This method decodes the part specified by *index* to a temporary file. The full path to the temporary file is returned by this method. The user is responsible for deleting the temporary file.

[DecodeFromString](#decodefromstring-method-ipworkspgp_mime-class) or [DecodeFromFile](#decodefromfile-method-ipworkspgp_mime-class) must be called before calling this method.

# EncodeToFile Method ([IPWorksPGP_MIME](#mime-class) Class)

This method encodes to a file.

## Object Oriented Interface

```text
public function doEncodeToFile();
```

## Procedural Interface

```text
ipworkspgp_mime_do_encodetofile($res);
```

## Remarks

This method encodes the data given in Parts properties (either a decoded file or a decoded string) into a MIME message at [Message](#message-property-ipworkspgp_mime-class) and MessageHeaders using the values optionally given in Parts properties. To encode several objects into a MIME envelope, the user should first clear any old values left in the Parts properties.

The class will check for each item in Parts properties (first the decoded file and then the decoded string) for the data to encode.

The encoded message will be saved in the file pointed to by [Message](#message-property-ipworkspgp_mime-class); the message headers will be held by MessageHeaders.

**Example. Encoding Data:**

```text
MIMEControl.ResetData()
MIMEControl.PartCount = 2
MIMEControl.PartDecodedString(0) = "This is plain text data"
MIMEControl.PartEncoding(0) = peQuotedPrintable
MIMEControl.PartContentType(0) = "text/plain"
MIMEControl.PartDecodedFile(1) = "C:\filename.txt"
MIMEControl.Message = "temp.tmp"
MIMEControl.EncodeToFile()
```

# EncodeToString Method ([IPWorksPGP_MIME](#mime-class) Class)

This method encodes to a string.

## Object Oriented Interface

```text
public function doEncodeToString();
```

## Procedural Interface

```text
ipworkspgp_mime_do_encodetostring($res);
```

## Remarks

This method encodes to a string. It is the same as [EncodeToFile](#encodetofile-method-ipworkspgp_mime-class) but the encoded data are held in the [Message](#message-property-ipworkspgp_mime-class) property rather than saved to a file.

This method encodes the data given in the Parts properties into a MIME message. The message gets stored in [Message](#message-property-ipworkspgp_mime-class) and MessageHeaders using the values optionally given in Parts properties. To encode several objects into a MIME envelope, the user should first clear any old values left in the Parts properties by calling [ResetData](#resetdata-method-ipworkspgp_mime-class).

The class will check each item in the Parts properties (first the decoded file and then the decoded string) for the data to encode.

The encoded message will be stored in the [Message](#message-property-ipworkspgp_mime-class) property; the message headers will be held by MessageHeaders.

**Example. Encoding Data:**

```text
MIMEControl.ResetData()
MIMEControl.PartCount = 2
MIMEControl.PartDecodedString(0) = "This is plain text data"
MIMEControl.PartEncoding(0) = peQuotedPrintable
MIMEControl.PartContentType(0) = "text/plain"
MIMEControl.PartDecodedFile(1) = "C:\filename.txt"
MIMEControl.EncodeToString()
```

# Reset Method ([IPWorksPGP_MIME](#mime-class) Class)

This method will reset the class.

## Object Oriented Interface

```text
public function doReset();
```

## Procedural Interface

```text
ipworkspgp_mime_do_reset($res);
```

## Remarks

This method will reset the class's properties to their default values.

# ResetData Method ([IPWorksPGP_MIME](#mime-class) Class)

This method resets the values of all headers and part properties.

## Object Oriented Interface

```text
public function doResetData();
```

## Procedural Interface

```text
ipworkspgp_mime_do_resetdata($res);
```

## Remarks

This method resets the values of all headers and part properties. It is an easy way to reset the class's properties before starting to populate the part properties with new values.

# Error Event ([IPWorksPGP_MIME](#mime-class) Class)

Fired when information is available about errors during data delivery.

## Object Oriented Interface

```text
public function fireError($param);
```

## Procedural Interface

```text
ipworkspgp_mime_register_callback($res, 1, array($this, 'fireError'));
```

## Parameter List

```text
 'errorcode' 'description'
```

## Remarks

The Error event is fired in case of exceptional conditions during message processing. Normally the class fails with an error.

The *ErrorCode* parameter contains an error code, and the *Description* parameter contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the [Error Codes](#trappable-errors-mime-class) section.

# Header Event ([IPWorksPGP_MIME](#mime-class) Class)

This event is fired every time a header is parsed.

## Object Oriented Interface

```text
public function fireHeader($param);
```

## Procedural Interface

```text
ipworkspgp_mime_register_callback($res, 2, array($this, 'fireHeader'));
```

## Parameter List

```text
 'partindex' 'field' 'value'
```

## Remarks

The *PartIndex* parameter contains the index of the part containing the current header. If the header is from the MIME body, this value will be -1. The *Field* parameter contains the name of the MIME header. The *Value* parameter contains the header contents. The Header event is fired when a header is parsed, which occurs for each header of the message when [DecodeFromFile](#decodefromfile-method-ipworkspgp_mime-class), [DecodeFromString](#decodefromstring-method-ipworkspgp_mime-class), or DecodeFromStream is called.

# Progress Event ([IPWorksPGP_MIME](#mime-class) Class)

This event shows the progress of decoding or encoding the input data.

## Object Oriented Interface

```text
public function fireProgress($param);
```

## Procedural Interface

```text
ipworkspgp_mime_register_callback($res, 3, array($this, 'fireProgress'));
```

## Parameter List

```text
 'percentdone'
```

## Remarks

The Progress allows the user to visualize the progress of processing the input data.

The *PercentDone* parameter shows what percentage of the input has been read.

# Config Settings ([MIME](#mime-class) Class)

 The class accepts one or more of the following *configuration settings*. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the class, access to these *internal properties* is provided through the [Config](#config-method-ipworkspgp_mime-class) method.

### MIME Config Settings

**DecodeMessageHeaders**: Instructs the component to automatically decode message headers.Message headers that have been Quoted-Printable or Base64 encoded are automatically decoded when this configuration setting is True. The default value of this setting is False.

**IncludeHeaders**: Tells the class whether to include the headers when encoding the message.If True, the class will include the headers when [EncodeToFile](#encodetofile-method-ipworkspgp_mime-class) or [EncodeToString](#encodetostring-method-ipworkspgp_mime-class) are called. If False, only the message will be encoded.

The default value for [IncludeHeaders](#IncludeHeaders) is False.

**RequireVersionHeader**: Specifies whether or not the class should require the version header.If True, the class will require that the "MIME-Version" header be included in the MessageHeaders. If the header is not present during decoding, the component fails with an error. This configuration setting is False by default.

**SanitizeFileName**: Whether invalid characters are replaced in MIME part filenames.If True, the class will replace invalid characters with an underscore when decoding the MIME message. This applies to the filename held in the [PartFileName](#partfilename-property-ipworkspgp_mime-class) property. When True, the following characters are considered invalid:

- \
- /
- "
- :
- ?
- *
- <
- >
- |

 Any characters with ASCII values between 0 and 31 are also considered invalid. The default value is False.

**TempFilePath**: If set, the temporary files created during MIME decoding and encoding will be put in the path specified. The [TempFilePath](#TempFilePath) property sets the path at which the temporary files will be created.

### Base Config Settings

**BuildInfo**: Information about the product's build.When queried, this setting will return a string containing information about the product's build.

**CodePage**: The system code page used for Unicode to Multibyte translations.The default code page is Unicode UTF-8 (65001).

The following is a list of valid code page identifiers:

|  |  |
| --- | --- |
| Identifier | Name |
| 037 | IBM EBCDIC - U.S./Canada |
| 437 | OEM - United States |
| 500 | IBM EBCDIC - International |
| 708 | Arabic - ASMO 708 |
| 709 | Arabic - ASMO 449+, BCON V4 |
| 710 | Arabic - Transparent Arabic |
| 720 | Arabic - Transparent ASMO |
| 737 | OEM - Greek (formerly 437G) |
| 775 | OEM - Baltic |
| 850 | OEM - Multilingual Latin I |
| 852 | OEM - Latin II |
| 855 | OEM - Cyrillic (primarily Russian) |
| 857 | OEM - Turkish |
| 858 | OEM - Multilingual Latin I + Euro symbol |
| 860 | OEM - Portuguese |
| 861 | OEM - Icelandic |
| 862 | OEM - Hebrew |
| 863 | OEM - Canadian-French |
| 864 | OEM - Arabic |
| 865 | OEM - Nordic |
| 866 | OEM - Russian |
| 869 | OEM - Modern Greek |
| 870 | IBM EBCDIC - Multilingual/ROECE (Latin-2) |
| 874 | ANSI/OEM - Thai (same as 28605, ISO 8859-15) |
| 875 | IBM EBCDIC - Modern Greek |
| 932 | ANSI/OEM - Japanese, Shift-JIS |
| 936 | ANSI/OEM - Simplified Chinese (PRC, Singapore) |
| 949 | ANSI/OEM - Korean (Unified Hangul Code) |
| 950 | ANSI/OEM - Traditional Chinese (Taiwan; Hong Kong SAR, PRC) |
| 1026 | IBM EBCDIC - Turkish (Latin-5) |
| 1047 | IBM EBCDIC - Latin 1/Open System |
| 1140 | IBM EBCDIC - U.S./Canada (037 + Euro symbol) |
| 1141 | IBM EBCDIC - Germany (20273 + Euro symbol) |
| 1142 | IBM EBCDIC - Denmark/Norway (20277 + Euro symbol) |
| 1143 | IBM EBCDIC - Finland/Sweden (20278 + Euro symbol) |
| 1144 | IBM EBCDIC - Italy (20280 + Euro symbol) |
| 1145 | IBM EBCDIC - Latin America/Spain (20284 + Euro symbol) |
| 1146 | IBM EBCDIC - United Kingdom (20285 + Euro symbol) |
| 1147 | IBM EBCDIC - France (20297 + Euro symbol) |
| 1148 | IBM EBCDIC - International (500 + Euro symbol) |
| 1149 | IBM EBCDIC - Icelandic (20871 + Euro symbol) |
| 1200 | Unicode UCS-2 Little-Endian (BMP of ISO 10646) |
| 1201 | Unicode UCS-2 Big-Endian |
| 1250 | ANSI - Central European |
| 1251 | ANSI - Cyrillic |
| 1252 | ANSI - Latin I |
| 1253 | ANSI - Greek |
| 1254 | ANSI - Turkish |
| 1255 | ANSI - Hebrew |
| 1256 | ANSI - Arabic |
| 1257 | ANSI - Baltic |
| 1258 | ANSI/OEM - Vietnamese |
| 1361 | Korean (Johab) |
| 10000 | MAC - Roman |
| 10001 | MAC - Japanese |
| 10002 | MAC - Traditional Chinese (Big5) |
| 10003 | MAC - Korean |
| 10004 | MAC - Arabic |
| 10005 | MAC - Hebrew |
| 10006 | MAC - Greek I |
| 10007 | MAC - Cyrillic |
| 10008 | MAC - Simplified Chinese (GB 2312) |
| 10010 | MAC - Romania |
| 10017 | MAC - Ukraine |
| 10021 | MAC - Thai |
| 10029 | MAC - Latin II |
| 10079 | MAC - Icelandic |
| 10081 | MAC - Turkish |
| 10082 | MAC - Croatia |
| 12000 | Unicode UCS-4 Little-Endian |
| 12001 | Unicode UCS-4 Big-Endian |
| 20000 | CNS - Taiwan |
| 20001 | TCA - Taiwan |
| 20002 | Eten - Taiwan |
| 20003 | IBM5550 - Taiwan |
| 20004 | TeleText - Taiwan |
| 20005 | Wang - Taiwan |
| 20105 | IA5 IRV International Alphabet No. 5 (7-bit) |
| 20106 | IA5 German (7-bit) |
| 20107 | IA5 Swedish (7-bit) |
| 20108 | IA5 Norwegian (7-bit) |
| 20127 | US-ASCII (7-bit) |
| 20261 | T.61 |
| 20269 | ISO 6937 Non-Spacing Accent |
| 20273 | IBM EBCDIC - Germany |
| 20277 | IBM EBCDIC - Denmark/Norway |
| 20278 | IBM EBCDIC - Finland/Sweden |
| 20280 | IBM EBCDIC - Italy |
| 20284 | IBM EBCDIC - Latin America/Spain |
| 20285 | IBM EBCDIC - United Kingdom |
| 20290 | IBM EBCDIC - Japanese Katakana Extended |
| 20297 | IBM EBCDIC - France |
| 20420 | IBM EBCDIC - Arabic |
| 20423 | IBM EBCDIC - Greek |
| 20424 | IBM EBCDIC - Hebrew |
| 20833 | IBM EBCDIC - Korean Extended |
| 20838 | IBM EBCDIC - Thai |
| 20866 | Russian - KOI8-R |
| 20871 | IBM EBCDIC - Icelandic |
| 20880 | IBM EBCDIC - Cyrillic (Russian) |
| 20905 | IBM EBCDIC - Turkish |
| 20924 | IBM EBCDIC - Latin-1/Open System (1047 + Euro symbol) |
| 20932 | JIS X 0208-1990 & 0121-1990 |
| 20936 | Simplified Chinese (GB2312) |
| 21025 | IBM EBCDIC - Cyrillic (Serbian, Bulgarian) |
| 21027 | Extended Alpha Lowercase |
| 21866 | Ukrainian (KOI8-U) |
| 28591 | ISO 8859-1 Latin I |
| 28592 | ISO 8859-2 Central Europe |
| 28593 | ISO 8859-3 Latin 3 |
| 28594 | ISO 8859-4 Baltic |
| 28595 | ISO 8859-5 Cyrillic |
| 28596 | ISO 8859-6 Arabic |
| 28597 | ISO 8859-7 Greek |
| 28598 | ISO 8859-8 Hebrew |
| 28599 | ISO 8859-9 Latin 5 |
| 28605 | ISO 8859-15 Latin 9 |
| 29001 | Europa 3 |
| 38598 | ISO 8859-8 Hebrew |
| 50220 | ISO 2022 Japanese with no halfwidth Katakana |
| 50221 | ISO 2022 Japanese with halfwidth Katakana |
| 50222 | ISO 2022 Japanese JIS X 0201-1989 |
| 50225 | ISO 2022 Korean |
| 50227 | ISO 2022 Simplified Chinese |
| 50229 | ISO 2022 Traditional Chinese |
| 50930 | Japanese (Katakana) Extended |
| 50931 | US/Canada and Japanese |
| 50933 | Korean Extended and Korean |
| 50935 | Simplified Chinese Extended and Simplified Chinese |
| 50936 | Simplified Chinese |
| 50937 | US/Canada and Traditional Chinese |
| 50939 | Japanese (Latin) Extended and Japanese |
| 51932 | EUC - Japanese |
| 51936 | EUC - Simplified Chinese |
| 51949 | EUC - Korean |
| 51950 | EUC - Traditional Chinese |
| 52936 | HZ-GB2312 Simplified Chinese |
| 54936 | Windows XP: GB18030 Simplified Chinese (4 Byte) |
| 57002 | ISCII Devanagari |
| 57003 | ISCII Bengali |
| 57004 | ISCII Tamil |
| 57005 | ISCII Telugu |
| 57006 | ISCII Assamese |
| 57007 | ISCII Oriya |
| 57008 | ISCII Kannada |
| 57009 | ISCII Malayalam |
| 57010 | ISCII Gujarati |
| 57011 | ISCII Punjabi |
| 65000 | Unicode UTF-7 |
| 65001 | Unicode UTF-8 |

 The following is a list of valid code page identifiers for Mac OS only:

|  |  |
| --- | --- |
| Identifier | Name |
| 1 | ASCII |
| 2 | NEXTSTEP |
| 3 | JapaneseEUC |
| 4 | UTF8 |
| 5 | ISOLatin1 |
| 6 | Symbol |
| 7 | NonLossyASCII |
| 8 | ShiftJIS |
| 9 | ISOLatin2 |
| 10 | Unicode |
| 11 | WindowsCP1251 |
| 12 | WindowsCP1252 |
| 13 | WindowsCP1253 |
| 14 | WindowsCP1254 |
| 15 | WindowsCP1250 |
| 21 | ISO2022JP |
| 30 | MacOSRoman |
| 10 | UTF16String |
| 0x90000100 | UTF16BigEndian |
| 0x94000100 | UTF16LittleEndian |
| 0x8c000100 | UTF32String |
| 0x98000100 | UTF32BigEndian |
| 0x9c000100 | UTF32LittleEndian |
| 65536 | Proprietary |

**LicenseInfo**: Information about the current license.When queried, this setting will return a string containing information about the license this instance of a class is using. It will return the following information:

- Product: The product the license is for.
- Product Key: The key the license was generated from.
- License Source: Where the license was found (e.g., RuntimeLicense, License File).
- License Type: The type of license installed (e.g., Royalty Free, Single Server).
- Last Valid Build: The last valid build number for which the license will work.

**MaskSensitiveData**: Whether sensitive data is masked in log messages.In certain circumstances it may be beneficial to mask sensitive data, like passwords, in log messages. Set this to *true* to mask sensitive data. The default is *true*.

**ProcessIdleEvents**: Whether the class uses its internal event loop to process events when the main thread is idle.If set to False, the class will not fire internal idle events. Set this to False to use the class in a background thread on Mac OS. By default, this setting is True.

**SelectWaitMillis**: The length of time in milliseconds the class will wait when DoEvents is called if there are no events to process.If there are no events to process when DoEvents is called, the class will wait for the amount of time specified here before returning. The default value is 20.

**UseFIPSCompliantAPI**: Tells the class whether or not to use FIPS certified APIs.When set to *true*, the class will utilize the underlying operating system's certified APIs. Java editions, regardless of OS, utilize Bouncy Castle Federal Information Processing Standards (FIPS), while all other Windows editions make use of Microsoft security libraries.

FIPS mode can be enabled by setting the *UseFIPSCompliantAPI* configuration setting to *true*. This is a static setting that applies to all instances of all classes of the toolkit within the process. It is recommended to enable or disable this setting once before the component has been used to establish a connection. Enabling FIPS while an instance of the component is active and connected may result in unexpected behavior.

For more details, please see the [FIPS 140-2 Compliance](https://www.nsoftware.com/kb/articles/fips.rst) article.

NOTE: This setting is applicable only on Windows.

NOTE: Enabling FIPS compliance requires a special license; please contact [sales@nsoftware.com](mailto:sales@nsoftware.com) for details.

**UseInternalSecurityAPI**: Whether or not to use the system security libraries or an internal implementation. When set to *false*, the class will use the system security libraries by default to perform cryptographic functions where applicable.

Setting this configuration setting to *true* tells the class to use the internal implementation instead of using the system security libraries.

 On Windows, this setting is set to *false* by default. On Linux/macOS, this setting is set to *true* by default.

 To use the system security libraries for Linux, OpenSSL support must be enabled. For more information on how to enable OpenSSL, please refer to the [OpenSSL Notes](platforms.md) section.

# Trappable Errors ([MIME](#mime-class) Class)

### MIME Errors

|  |  |
| --- | --- |
| 3 | Can't create the file for write (illegal name or disk is write-protected). |
| 4 | Can't open the file for read (doesn't exist?). |
| 5 | Can't read from file. |
| 6 | Can't write to file (disk full?). |
| 280 | Invalid Part Index. |
| 281 | Unknown MIME type. |
| 282 | No MIME-boundary found. |
| 283 | No file given. |
| 284 | The class is busy. |
| 285 | Can't create a temporary file to decode the data. |
| 286 | Can't read [Message](#message-property-ipworkspgp_mime-class) file. |
| 287 | No header separator found. |
| 289 | No separator found. |
| 290 | Input stream must have seeking enabled. |
