EmailParser.ParseContainer
--------------------------

Parses an email stored in container.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [EmailParser](component_EmailParser.md) | [6.3](newinversion63.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "EmailParser.ParseContainer"; EmailSource ) 

**MBS**( **"EmailParser.ParseContainer";** /\* Parses an email stored in container. \*/  
**$EmailSource**) /\* The container field that holds the EML file to be parsed.  
  
The container value, which embeds the email text as FILE data.  
e.g. you imported the eml file into the container with our plugin or Filemaker's import script step.e.g. MyTable::myContainer \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| EmailSource | The container field that holds the EML file to be parsed.      The container value, which embeds the email text as FILE data.   e.g. you imported the eml file into the container with our plugin or Filemaker's import script step. | MyTable::myContainer |

### Result

Returns reference number or error.

### Description

Parses an email stored in container.  
Parses an email file stored in container and returns a reference that can be used by other [EmailParser](component_EmailParser.md) functions to extract specific data elements (e.g. [EmailParser.Subject](EmailParserSubject.md) to extract the email subject).  
  
This function applies only to EML files. For EMLX files, please use the [Text.ReadEMLXFile](TextReadEMLXFile.md) function to extract the source of the email file and then use the [EmailParser.Parse](EmailParserParse.md) function to get a reference for further parsing).  
  
Be sure to use [EmailParser.Release](EmailParserRelease.md) to release the reference once you have finished processing the email file. This frees up memory that is holding the parsed email.  
  
If no error occurs, the parser will separate subject, html and plain text, attachments and inline graphics, all addresses and header entries. You can then use other [EmailParser](component_EmailParser.md) functions to query values.  
  
This functionality needs libiconv. On macOS, iOS and Linux we try to load the library coming with the OS. If you use Windows or like to use a custom library, please use [Plugin.LoadIconvLibrary](PluginLoadIconvLibrary.md) function to load it before calling this function.  
Without iconv library, only a minimum functionality is done by plugin directly to keep basic functionality working.  
### See also

- [EmailParser.Parse](EmailParserParse.md)
- [EmailParser.Release](EmailParserRelease.md)
- [EmailParser.Subject](EmailParserSubject.md)
- [Plugin.LoadIconvLibrary](PluginLoadIconvLibrary.md)
- [Text.ReadEMLXFile](TextReadEMLXFile.md)

### Release notes

- **Version 12.0**
    - Fixed a problem in email parser, which didn't get multi part right on Linux for [EmailParser.Parse](https://www.mbsplugins.eu/EmailParserParse.shtml), [EmailParser.ParseContainer](https://www.mbsplugins.eu/EmailParserParseContainer.shtml) and [EmailParser.ParseFile](https://www.mbsplugins.eu/EmailParserParseFile.shtml).

### Blog Entries

- [MBS Plugin Advent calendar: 23 - MailParser](https://www.mbsplugins.de/archive/2023-12-23/MBS_Plugin_Advent_calendar_23_/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 11.6pr3](https://www.mbsplugins.de/archive/2021-12-14/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 6.3pr2](https://www.mbsplugins.de/archive/2016-06-10/MBS_FileMaker_Plugin_version_6/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 4th June 2016 , last changed 23th May 2024

  
[EmailParser.Parse](EmailParserParse.md) - [EmailParser.ParseFile](EmailParserParseFile.md)

[HTML Version](EmailParserParseContainer.shtml)