SendMail.SetPlainText
---------------------

Sets the plain text of the new email.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SendMail](component_SendMail.md) | [4.3](newinversion43.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "SendMail.SetPlainText"; EmailID; Text ) 

**MBS**( **"SendMail.SetPlainText";** /\* Sets the plain text of the new email. \*/  
**$EmailID**; /\* The email reference number obtained using [SendMail.CreateEmail](SendMailCreateEmail.md) function. \*/   
**$Text**) /\* The plain text for the email. Will be encoded by the plugin to quoted printable UTF-8.e.g. Email::PlainText \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| EmailID | The email reference number obtained using [SendMail.CreateEmail](SendMailCreateEmail.md) function. | $EmailID |
| Text | The plain text for the email. Will be encoded by the plugin to quoted printable UTF-8. | Email::PlainText |

### Result

Returns OK or error.

### Description

Sets the plain text of the new email.  
See also [SendMail.SetHTMLText](SendMailSetHTMLText.md) and [SendMail.SetRichText](SendMailSetRichText.md).  
You can read text content from file using the [Text.ReadTextFile](TextReadTextFile.md) function.  
  
You can use [Text.MergeFields](TextMergeFields.md) to replace placeholders with values from variables, fields and expressions.  
### Examples

Create email and set content:

 Set Variable \[$EmailID ; Value:MBS ("[SendMail.CreateEmail](SendMailCreateEmail.md)")\]  
Set Variable \[$r ; Value:MBS ("SendMail.SetPlainText"; $EmailID ; "Hello World")\]  
Sets the text as plain text and as html:

 Set Variable \[ $r ; Value: MBS ("[SendMail.SetHTMLText](SendMailSetHTMLText.md)"; $EmailID ; "&lt;html&gt;&lt;body&gt;" &amp; GetAsCSS(EMail::PlainText ) &amp; "&lt;/body&gt;&lt;/html&gt;") \]   
Set Variable \[ $r ; Value: MBS ("SendMail.SetPlainText"; $EmailID ; EMail::PlainText ) \]  
### See also

- [Archive.CompressContainer](ArchiveCompressContainer.md)
- [Archive.CompressText](ArchiveCompressText.md)
- [Archive.Create](ArchiveCreate.md)
- [SendMail.CreateEmail](SendMailCreateEmail.md)
- [SendMail.GetPlainText](SendMailGetPlainText.md)
- [SendMail.PrepareCURL](SendMailPrepareCURL.md)
- [SendMail.SetHTMLText](SendMailSetHTMLText.md)
- [SendMail.SetRichText](SendMailSetRichText.md)
- [Text.MergeFields](TextMergeFields.md)
- [Text.ReadTextFile](TextReadTextFile.md)

### Example Databases

- [CURL/Email/Batch Emailer](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Batch%20Emailer.shtml#1ScriptAnchor_)
- [CURL/Email/Build and send Email](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Build%20and%20send%20Email.shtml#1ScriptAnchor_)
- [CURL/Email/Build and send HTML Email with inline graphics](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Build%20and%20send%20HTML%20Email%20with%20inline%20graphics.shtml#1ScriptAnchor_)
- [CURL/Email/GMail oAuth SMTP](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/GMail%20oAuth%20SMTP.shtml#5ScriptAnchor_)
- [CURL/Email/Office 365 oAuth SMTP](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/CURL/Email/Office%20365%20oAuth%20SMTP.shtml#5ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Advent calendar - Door 12 - Sending Mails](https://www.mbsplugins.de/archive/2024-12-12/MBS_FileMaker_Advent_calendar_/monkeybreadsoftware_blog_filemaker)
- [Compress and Send](https://www.mbsplugins.de/archive/2024-07-06/Compress_and_Send/monkeybreadsoftware_blog_filemaker)
- [SMTP with OAuth for Office 365 in FileMaker](https://www.mbsplugins.de/archive/2022-11-22/SMTP_with_OAuth_for_Office_365/monkeybreadsoftware_blog_filemaker)
- [Sending email with a huge custom function](https://www.mbsplugins.de/archive/2021-06-26/Sending_email_with_a_huge_cust/monkeybreadsoftware_blog_filemaker)
- [Email Script for FileMaker](https://www.mbsplugins.de/archive/2018-10-10/Email_Script_for_FileMaker/monkeybreadsoftware_blog_filemaker)
- [Sending emails in FileMaker with MBS Plugin](https://www.mbsplugins.de/archive/2016-10-03/Sending_emails_in_FileMaker_wi/monkeybreadsoftware_blog_filemaker)
- [Sending Email with FileMaker via MBS Plugin](https://www.mbsplugins.de/archive/2014-09-29/Sending_Email_with_FileMaker_v/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 5/2014, Seite 25](https://filemaker-magazin.de/neuigkeit/3759-Appetithappen-FMM_201405)

This function checks for a license.

Created 3th September 2014 , last changed 15th October 2018

  
[SendMail.SetMessageID](SendMailSetMessageID.md) - [SendMail.SetRichText](SendMailSetRichText.md)

[HTML Version](SendMailSetPlainText.shtml)