SendMail.CreateEmail
--------------------

Creates a 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.CreateEmail" { ; Encoding } ) 

**MBS**( **"SendMail.CreateEmail";** /\* Creates a new email. \*/  
**$Encoding**) /\* Optional; The text encoding to use for the email. If unspecified we use "UTF-8".  
Can be UTF-8, macintosh, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1257, ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9 or ISO-8859-15.e.g. "UTF-8" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Encoding | The text encoding to use for the email. If unspecified we use "UTF-8".   Can be UTF-8, macintosh, windows-1250, windows-1251, windows-1252, windows-1253, windows-1254, windows-1255, windows-1256, windows-1257, ISO-8859-1, ISO-8859-2, ISO-8859-3, ISO-8859-5, ISO-8859-6, ISO-8859-7, ISO-8859-8, ISO-8859-9 or ISO-8859-15.   Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the [FAQ](https://www.monkeybreadsoftware.com/filemaker/faq.shtml). | "UTF-8" | Optional |

### Result

Returns Email ID or error.

### Description

Creates a new email.  
The reference number returned by this function can be passed to other plugin functions for setting up the email.  
Later use [SendMail.Release](SendMailRelease.md) to free memory.  
SendMail reference numbers are starting at 14000 and counting up for each new email.  
### See also

- [SendMail.SetFrom](SendMailSetFrom.md)
- [SendMail.SetHTMLText](SendMailSetHTMLText.md)
- [SendMail.SetInReplyTo](SendMailSetInReplyTo.md)
- [SendMail.SetMessageID](SendMailSetMessageID.md)
- [SendMail.SetPlainText](SendMailSetPlainText.md)
- [SendMail.SetSMTPServer](SendMailSetSMTPServer.md)
- [SendMail.SetSMTPUserName](SendMailSetSMTPUserName.md)
- [SendMail.SetSubject](SendMailSetSubject.md)
- [SendMail.SetUse8BitMime](SendMailSetUse8BitMime.md)
- [SendMail.Sign](SendMailSign.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)
- [MBS Plugin Advent calendar: 21 - SendMail](https://www.mbsplugins.de/archive/2023-12-21/MBS_Plugin_Advent_calendar_21_/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)
- [Use Inline Graphics in Emails](https://www.mbsplugins.de/archive/2021-02-11/Use_Inline_Graphics_in_Emails/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)
- [MBS Filemaker Plugin, version 4.4pr10](https://www.mbsplugins.de/archive/2014-11-08/MBS_Filemaker_Plugin_version_4/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 6/2024, Seite 38](https://filemaker-magazin.de/neuigkeit/4277-Appetithappen-FMM_202406)
- [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 12nd November 2015

  
[SendMail.ClearRecipients](SendMailClearRecipients.md) - [SendMail.GetHTMLText](SendMailGetHTMLText.md)

[HTML Version](SendMailCreateEmail.shtml)