WinSendMail.AddRecipient
------------------------

Adds a recipient.

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

MBS( "WinSendMail.AddRecipient"; WinSendMailRef; Type; Email; Name ) 

**MBS**( **"WinSendMail.AddRecipient";** /\* Adds a recipient. \*/  
**$WinSendMailRef**; /\* The email reference number obtained using WinSendMai.CreateEmail function.e.g. $Email \*/   
**$Type**; /\* The type of recipient. Can be TO, BCC, CC or ReplyTo.e.g. "CC" \*/   
**$Email**; /\* The email address of the recipient.e.g. "SMTP:test@mbsplugins.de" \*/   
**$Name**) /\* The name of the recipient.  
Not optional when using MAPI with Outlook.e.g. "John Miller" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| WinSendMailRef | The email reference number obtained using WinSendMai.CreateEmail function. | $Email |
| Type | The type of recipient. Can be TO, BCC, CC or ReplyTo. | "CC" |
| Email | The email address of the recipient. | "SMTP:test@mbsplugins.de" |
| Name | The name of the recipient.   Not optional when using MAPI with Outlook. | "John Miller" |

### Result

Returns OK or error.

### Description

Adds a recipient.  
This function can be used easily if the type is also a field in your database.  
As an alternative you can of course also use [WinSendMail.AddTo](WinSendMailAddTo.md), WinSendMail.AddReplyTo, [WinSendMail.AddCC](WinSendMailAddCC.md) or [WinSendMail.AddBCC](WinSendMailAddBCC.md).  
You can call this method several times to add several recipients.  
  
Email addresses need to be prefixed with "SMTP:".  
### See also

- [SendMail.AddBCC](SendMailAddBCC.md)
- [SendMail.AddCC](SendMailAddCC.md)
- [SendMail.AddRecipient](SendMailAddRecipient.md)
- [SendMail.AddReplyTo](SendMailAddReplyTo.md)
- [SendMail.AddTo](SendMailAddTo.md)
- [WinSendMail.AddBCC](WinSendMailAddBCC.md)
- [WinSendMail.AddCC](WinSendMailAddCC.md)
- [WinSendMail.AddTo](WinSendMailAddTo.md)
- [WinSendMail.ClearRecipients](WinSendMailClearRecipients.md)

### Release notes

- **Version 12.0**
    - Fixed a problem with [WinSendMail.AddBCC](https://www.mbsplugins.eu/WinSendMailAddBCC.shtml), [WinSendMail.AddCC](https://www.mbsplugins.eu/WinSendMailAddCC.shtml), [WinSendMail.AddRecipient](https://www.mbsplugins.eu/WinSendMailAddRecipient.shtml), [WinSendMail.AddTo](https://www.mbsplugins.eu/WinSendMailAddTo.shtml) not passing email when name is empty.

### Blog Entries

- [MBS FileMaker Plugin, version 11.6pr4](https://www.mbsplugins.de/archive/2021-12-22/MBS_FileMaker_Plugin_version_1/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 28th February 2017 , last changed 9th September 2020

  
[WinSendMail.AddCC](WinSendMailAddCC.md) - [WinSendMail.AddTo](WinSendMailAddTo.md)

[HTML Version](WinSendMailAddRecipient.shtml)