MailComposer.SetSubject
-----------------------

Sets the Subject header for the email message.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [MailComposer](component_MailComposer.md) | [7.3](newinversion73.md) | ❌ No | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "MailComposer.SetSubject"; Subject ) 

**MBS**( **"MailComposer.SetSubject";** /\* Sets the Subject header for the email message. \*/  
**$Subject**) /\* The new subject.e.g. "Hello World" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Subject | The new subject. | "Hello World" |

### Result

Returns OK or error.

### Description

Sets the Subject header for the email message.  
This method will set the Subject header for the email message. This should be called prior to display.  
Newlines are removed from the parameter.  
After the view has been presented to the user, this method will no longer change the value.  
### Examples

Start a new email:

 Set Variable \[ $r ; Value: MBS ( "[MailComposer.New](MailComposerNew.md)" ) \]   
Set Variable \[ $r ; Value: MBS ( "MailComposer.SetSubject"; PlaceHolder::Subject ) \]  
### See also

- [MailComposer.GetSubject](MailComposerGetSubject.md)
- [MailComposer.New](MailComposerNew.md)
- [MailComposer.Present](MailComposerPresent.md)
- [MailComposer.SetScript](MailComposerSetScript.md)
- [MessageComposer.GetSubject](MessageComposerGetSubject.md)
- [MessageComposer.SetSubject](MessageComposerSetSubject.md)

### Example Databases

- [iOS/Examples/iOS Email Sending](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/iOS/Examples/iOS%20Email%20Sending.shtml#4ScriptAnchor_)

This function is free to use.

Created 10th June 2017 , last changed 10th June 2017

  
[MailComposer.SetScript](MailComposerSetScript.md) - [MailComposer.SetTORecipients](MailComposerSetTORecipients.md)

[HTML Version](MailComposerSetSubject.shtml)