WinSendMail.Send
----------------

Sends email.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WinSendMail](component_WinSendMail.md) | [7.1](newinversion71.md) | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "WinSendMail.Send"; WinSendMailRef; Flags ) 

**MBS**( **"WinSendMail.Send";** /\* Sends email. \*/  
**$WinSendMailRef**; /\* The email reference number obtained using WinSendMai.CreateEmail function.e.g. $Email \*/   
**$Flags**) /\* The flags.  
Add 1 to show no dialog.  
Add 2 to disable logon user interface.  
Add 4 to disable parent window.e.g. 0 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WinSendMailRef | The email reference number obtained using WinSendMai.CreateEmail function. | $Email |
| Flags | The flags.   Add 1 to show no dialog.   Add 2 to disable logon user interface.   Add 4 to disable parent window. | 0 |

### Result

Returns OK or error.

### Description

Sends email.  
The email is sent using the locally installed mail client.  
Some email clients seem not to like more than one attachment.  
  
With outlook you can keep text empty and attach a html file. Then Outlook will use the html file as content of the email and allows you to send html email.  
  
Falls back to [WinSendMail.SendAnsi](WinSendMailSendAnsi.md) if Unicode support is missing in older Windows versions.  
  
Outlook loves to return failed, if you pass in email address for To/BCC/CC and no name.  
See [WinSendMail.SendAsync](WinSendMailSendAsync.md) for having a function which does not wait.  
### See also

- [WinSendMail.CreateEmail](WinSendMailCreateEmail.md)
- [WinSendMail.SendAnsi](WinSendMailSendAnsi.md)
- [WinSendMail.SendAsync](WinSendMailSendAsync.md)

### Release notes

- **Version 9.1**
    - Added [WinSendMail.SendAsync](http://www.mbsplugins.eu/WinSendMailSendAsync.shtml) function.
- **Version 8.3**
    - Fixed problem with [WinSendMail.Send](http://www.mbsplugins.eu/WinSendMailSend.shtml) for one user.

### Example Databases

- [Win Only/Send Email via Email Application](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/Send%20Email%20via%20Email%20Application.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 8.3pr6](https://www.mbsplugins.de/archive/2018-07-13/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function is free to use.

Created 28th February 2017 , last changed 11st April 2023

  
[WinSendMail.ReleaseAll](WinSendMailReleaseAll.md) - [WinSendMail.SendAnsi](WinSendMailSendAnsi.md)

[HTML Version](WinSendMailSend.shtml)