EmailParser.HTMLToPlainText
---------------------------

Converts HTML to plain text.

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

MBS( "EmailParser.HTMLToPlainText"; HTML ) 

**MBS**( **"EmailParser.HTMLToPlainText";** /\* Converts HTML to plain text. \*/  
**$HTML**) /\* The HTML text to convert.e.g. "&lt;p&gt;Hello World&lt;/p&gt;" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| HTML | The HTML text to convert. | "&lt;p&gt;Hello World&lt;/p&gt;" |

### Result

Returns text or error.

### Description

Converts HTML to plain text.  
This is used internally for HTML only emails.  
Does not convert formatting. Just removes html tags, adds new line characters and translates html entities.  
  
See also [Text.DecodeFromHTML](TextDecodeFromHTML.md) for just removing html entities.  
### See also

- [EmailParser.PlainText](EmailParserPlainText.md)
- [RichText.ReadHTML](RichTextReadHTML.md)
- [Text.DecodeFromHTML](TextDecodeFromHTML.md)

### Release notes

- **Version 15.4**
    - Improved [EmailParser.HTMLToPlainText](https://www.mbsplugins.eu/EmailParserHTMLToPlainText.shtml) to avoid initial return character.
- **Version 14.2**
    - Improved [EmailParser.HTMLToPlainText](https://www.mbsplugins.eu/EmailParserHTMLToPlainText.shtml) to handle title tag.
- **Version 12.5**
    - Improved [EmailParser.HTMLToPlainText](https://www.mbsplugins.eu/EmailParserHTMLToPlainText.shtml) function to better handle comments in html and div tags.
- **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.
- **Version 8.5**
    - Improved [EmailParser.HTMLToPlainText](http://www.mbsplugins.eu/EmailParserHTMLToPlainText.shtml) to better filter JavaScript.

### Example Databases

- [Text functions/HTML to formatted text](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Text%20functions/HTML%20to%20formatted%20text.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 15.4pr2](https://www.mbsplugins.de/archive/2025-08-12/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 14.2pr1](https://www.mbsplugins.de/archive/2024-04-02/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 12.5pr3](https://www.mbsplugins.de/archive/2022-10-14/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [Neues MBS FileMaker Plugin 11.0](https://www.mbsplugins.de/archive/2021-01-19/Neues_MBS_FileMaker_Plugin_110/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin 11.0 - More than 6400 Functions In One Plugin](https://www.mbsplugins.de/archive/2021-01-19/MBS_FileMaker_Plugin_110_-_Mor/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 10.6pr1](https://www.mbsplugins.de/archive/2020-12-02/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 8.5pr1](https://www.mbsplugins.de/archive/2018-10-02/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 24th September 2015 , last changed 22nd August 2018

  
[EmailParser.HTMLText](EmailParserHTMLText.md) - [EmailParser.HasHeader](EmailParserHasHeader.md)

[HTML Version](EmailParserHTMLToPlainText.shtml)