# mime_parse

### (PRO) mime_parse(email, isGoldMine)

Parse the content of the MIME encoded email field and extract the various elements:

- header - full header of the email
- subject - subject line of the email
- body - body test of the email (may be HTML formatted)
- to / from / cc / bcc
- attachment list - semicolon separated list of paths to attached files

## Arguments

Argument | Data Type | Description
email | string | Full text of the MIME encoded email
isGoldMine | boolean | If TRUE, specifies that the email comes from a GoldMine RFC822 field. GoldMine does not use standard MIME formatting.

## Returns

An object that holds the decoded MIME email. This is not useful by itself - you reference the object by using the other mime functions: mime_hdr(), mime_to(), mime_from(), mime_subject(), mime_body(), mime_filelist()

## Description

The "email" field is normally:

- the contents of an ACT email file (".ima" file type), or
- the contents of a GoldMine mailbox.rfc822 field from the GoldMine database.

The function is used to parse the contents of the MIME email into its constituent elements. Normally you will create a new field in tab 3 and use the mime_parse() function to store the parsed email elements. You then use this new field as the parameter to the various functions that actually extract the email elements.

NOTE: Email parsing is an expensive operation, and may cause temporary files to be created to store the email attachments.

## Examples

Example | Description
--- | ---
mime_parse(#rfc822, "true") | Read the contents of the GoldMine RFC822 field and parse it.
mime_parse(readfile(#Attachment)) | Read the file specified in the Attachment field, and then parse it.

## See Also