Component: EmailParser 
-----------------------

Functions to parse emails and extract text, addresses and attachments.

Use [CURL](component_CURL.md) functions to query POP and IMAP servers to obtain the email content or load it from eml/emlx files.  
  
You can send or receive emails with our [CURL](component_CURL.md) functions. For sending the [SendMail](component_SendMail.md) functions help to build an email and send it, while [EmailParser](component_EmailParser.md) functions help to parse an email.

| Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|
| [5.3](newinversion53.md "First functions introduced with version 5.3.") / [14.3](newinversion143.md "Newest functions in version 14.3.") | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

  
| Item | Details |
|:--|:--|
| [EmailParser.Address](EmailParserAddress.md)   Queries an address value. | All   5.3 |
| [EmailParser.AddressCount](EmailParserAddressCount.md)   Queries number of addresses. | All   5.3 |
| [EmailParser.AttachedEmails](EmailParserAttachedEmails.md)   Queries email IDs for embedded emails. | All   9.4 |
| [EmailParser.Attachment](EmailParserAttachment.md)   Queries an attachment property. | All   5.3 |
| [EmailParser.AttachmentCount](EmailParserAttachmentCount.md)   Queries number of attachments. | All   5.3 |
| [EmailParser.HTMLText](EmailParserHTMLText.md)   Queries html text of email. | All   5.3 |
| [EmailParser.HTMLToPlainText](EmailParserHTMLToPlainText.md)   Converts HTML to plain text. | All   5.3 |
| [EmailParser.HasHeader](EmailParserHasHeader.md)   Checks if header exists. | All   7.4 |
| [EmailParser.Hash](EmailParserHash.md)   Returns a SHA512 hash for the email source parsed. | All   5.4 |
| [EmailParser.Header](EmailParserHeader.md)   Queries a header entry. | All   5.3 |
| [EmailParser.HeaderCount](EmailParserHeaderCount.md)   Queries number of header entries. | All   5.3 |
| [EmailParser.HeaderValue](EmailParserHeaderValue.md)   Queries header value by header name. | All   7.4 |
| [EmailParser.Inline](EmailParserInline.md)   Queries an inline graphics property. | All   5.3 |
| [EmailParser.InlineCount](EmailParserInlineCount.md)   Queries number of inline images. | All   5.3 |
| [EmailParser.List](EmailParserList.md)   Lists all email parser reference numbers. | All   5.3 |
| [EmailParser.MessageID](EmailParserMessageID.md)   Queries the message ID of the email. | All   5.3 |
| [EmailParser.Parse](EmailParserParse.md)   Parses an email. | All   5.3 |
| [EmailParser.ParseContainer](EmailParserParseContainer.md)   Parses an email stored in container. | All   6.3 |
| [EmailParser.ParseFile](EmailParserParseFile.md)   Parses an email from a file. | All   5.3 |
| [EmailParser.PlainText](EmailParserPlainText.md)   Queries plain text of email. | All   5.3 |
| [EmailParser.ProcessImageReferences](EmailParserProcessImageReferences.md)   Processes image references in HTML. | All   6.3 |
| [EmailParser.ReceiveDate](EmailParserReceiveDate.md)   Queries the date and time of the email. | All   6.4 |
| [EmailParser.Release](EmailParserRelease.md)   Frees the email parser. | All   5.3 |
| [EmailParser.ReleaseAll](EmailParserReleaseAll.md)   Releases all emails. | All   14.3 |
| [EmailParser.SentDate](EmailParserSentDate.md)   Queries the date and time of the email. | All   5.4 |
| [EmailParser.Source](EmailParserSource.md)   Returns the source of the email as we parsed it. | All   5.4 |
| [EmailParser.SourceWithoutAttachments](EmailParserSourceWithoutAttachments.md)   Returns the source of the email without attachments. | All   5.4 |
| [EmailParser.Subject](EmailParserSubject.md)   Queries the subject line of the email. | All   5.3 |
| [EmailParser.WriteAttachment](EmailParserWriteAttachment.md)   Writes an attachment to a file path. | All   5.3 |
| [EmailParser.WriteInline](EmailParserWriteInline.md)   Writes an inline graphics to a file path. | All   5.3 |

30 functions shown.

### Release notes

- **Version 15.4**
    - Improved [EmailParser.HTMLToPlainText](https://www.mbsplugins.eu/EmailParserHTMLToPlainText.shtml) to avoid initial return character.
- **Version 14.3**
    - Added [EmailParser.ReleaseAll](https://www.mbsplugins.eu/EmailParserReleaseAll.shtml) function.
    - Renamed [EmailParser.Free](https://www.mbsplugins.eu/EmailParserRelease.shtml) to [EmailParser.Release](https://www.mbsplugins.eu/EmailParserRelease.shtml), but old name will stay valid.
- **Version 14.2**
    - Fixed an issue with [EmailParser.ReceiveDate](https://www.mbsplugins.eu/EmailParserReceiveDate.shtml) and [EmailParser.SentDate](https://www.mbsplugins.eu/EmailParserSentDate.shtml) function with east asian time zones.
    - Improved [EmailParser.HTMLToPlainText](https://www.mbsplugins.eu/EmailParserHTMLToPlainText.shtml) to handle title tag.
- **Version 13.2**
    - Improved [EmailParser.Attachment](https://www.mbsplugins.eu/EmailParserAttachment.shtml) function to better handle PDF documents and return them as PDF container with preview.
- **Version 12.5**
    - Improved [EmailParser.HTMLToPlainText](https://www.mbsplugins.eu/EmailParserHTMLToPlainText.shtml) function to better handle comments in html and div tags.
- **Version 12.2**
    - Fixed an edge case in [EmailParser](https://www.mbsplugins.eu/component_EmailParser.shtml) functions where file name got an extra space in front.
- **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).
- **Version 11.3**
    - Fixed a problem with a [math](https://www.mbsplugins.eu/component_Math.shtml) function, which affected time zone calculation for [EmailParser.SentDate](https://www.mbsplugins.eu/EmailParserSentDate.shtml), [EmailParser.ReceiveDate](https://www.mbsplugins.eu/EmailParserReceiveDate.shtml) and [Time.TimeStampToUTC](https://www.mbsplugins.eu/TimeTimeStampToUTC.shtml) functions (broken in v11.2).
- **Version 11.0**
    - Optimized [EmailParser.HTMLToPlainText](https://www.mbsplugins.eu/EmailParserHTMLToPlainText.shtml) function to add new line after pre element and to skip space runs.

### Blog Entries

- [MBS @ FMTraining.TV - MBS Open Q&amp;A](https://www.mbsplugins.de/archive/2025-06-28/MBS_@_FMTrainingTV_-_MBS_Open_/monkeybreadsoftware_blog_filemaker)
- [Electronic invoices in FileMaker](https://www.mbsplugins.de/archive/2025-03-06/Electronic_invoices_in_FileMak/monkeybreadsoftware_blog_filemaker)
- [Elektronische Rechnungen in FileMaker](https://www.mbsplugins.de/archive/2025-03-04/Elektronische_Rechnungen_in_Fi/monkeybreadsoftware_blog_filemaker)
- [Validating schema for electronic invoices with ZUGFeRD](https://www.mbsplugins.de/archive/2024-10-11/Validating_schema_for_electron/monkeybreadsoftware_blog_filemaker)
- [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 12.2pr4](https://www.mbsplugins.de/archive/2022-04-28/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [GMail for emails with MBS Plugin](https://www.mbsplugins.de/archive/2021-04-18/GMail_for_emails_with_MBS_Plug/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.4pr7](https://www.mbsplugins.de/archive/2020-09-01/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 6.4 for OS X/Windows](https://www.mbsplugins.de/archive/2016-09-27/MBS_FileMaker_Plugin_64_for_OS/monkeybreadsoftware_blog_filemaker)
- [\[ANN\] MBS FileMaker Plugin 5.3 for OS X/Windows](https://www.mbsplugins.de/archive/2015-10-01/[ANN]_MBS_FileMaker_Plugin_53_/monkeybreadsoftware_blog_filemaker)

### Example Databases

- [CURL/Email/Email Client](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Email%20Client.shtml#1ScriptAnchor_)
- [CURL/Email/Email Parser and Preview](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Email%20Parser%20and%20Preview.shtml#1ScriptAnchor_)
- [CURL/Email/Email Parser](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Email%20Parser.shtml#1ScriptAnchor_)
- [CURL/Email/IMAP Email](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/IMAP%20Email.shtml#4ScriptAnchor_)
- [Drag and Drop/DragTest](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/DragTest.shtml#7ScriptAnchor_)
- [Drag and Drop/for Mac/DragTest Email](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Drag%20and%20Drop/for%20Mac/DragTest%20Email.shtml#3ScriptAnchor_)
- [Text functions/HTML to formatted text](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Text%20functions/HTML%20to%20formatted%20text.shtml#1ScriptAnchor_)

[HTML Version](component_EmailParser.shtml)