WinSendMail.SetFrom
-------------------

Sets the email from address.

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

MBS( "WinSendMail.SetFrom"; WinSendMailRef; Email { ; Name } ) 

**MBS**( **"WinSendMail.SetFrom";** /\* Sets the email from address. \*/  
**$WinSendMailRef**; /\* The email reference number obtained using WinSendMai.CreateEmail function.e.g. $Email \*/   
**$Email**; /\* The email address of the from field.e.g. "test@mbsplugins.de" \*/   
**$Name**) /\* Optional; Optional the name of the from field.   
If this name contains special characters, it will be automatically encoded with UTF-8.   
Do not put an email address here!e.g. "John Miller" \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| WinSendMailRef | The email reference number obtained using WinSendMai.CreateEmail function. | $Email |  |
| Email | The email address of the from field. | "test@mbsplugins.de" |  |
| Name | Optional the name of the from field.    If this name contains special characters, it will be automatically encoded with UTF-8.    Do not put an email address here! | "John Miller" | Optional |

### Result

Returns OK or error.

### Description

Sets the email from address.  
Email addresses need to be prefixed with "SMTP:".  
### Examples

Sets the from address:

 Set Variable \[ $r ; Value:MBS ( "WinSendMail.SetFrom"; $email ; Send::From Email ; Send::From Name ) \]  
### See also

- [SendMail.SetFrom](SendMailSetFrom.md)
- [WinSendMail.CreateEmail](WinSendMailCreateEmail.md)
- [WinSendMail.GetText](WinSendMailGetText.md)
- [WinSendMail.SetText](WinSendMailSetText.md)

### 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_)

This function checks for a license.

Created 28th February 2017 , last changed 25th October 2023

  
[WinSendMail.SendAsync](WinSendMailSendAsync.md) - [WinSendMail.SetSubject](WinSendMailSetSubject.md)

[HTML Version](WinSendMailSetFrom.shtml)