MailComposer.Present
--------------------

Presents the email composer view.

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

MBS( "MailComposer.Present" ) ### Parameters

none

### Result

Returns OK or error.

### Description

Presents the email composer view.  
This will show the user interface and start the process.  
Your script may call this in a script and than wait for the script trigger.  
### Examples

Setups email and send:

 Set Variable \[ $r ; Value: MBS ( "[MailComposer.CanSendMail](MailComposerCanSendMail.md)" ) \]   
If \[ $r ≠ 1 \]   
 Show Custom Dialog \[ "Can't send emails." ; "This iOS device is not configured to send emails." \]   
 Exit Script \[ Text Result: "failed" \]   
End If  
Set Variable \[ $r ; Value: MBS ( "[MailComposer.New](MailComposerNew.md)" ) \]   
Set Variable \[ $r ; Value: MBS ( "[MailComposer.SetSubject](MailComposerSetSubject.md)"; PlaceHolder::Subject ) \]   
Set Variable \[ $r ; Value: MBS ( "[MailComposer.SetScript](MailComposerSetScript.md)"; Get(FileName); "Sent") \]   
If \[ Length ( PlaceHolder::Body ) &gt; 0 \]   
 Set Variable \[ $r ; Value: MBS ( "[MailComposer.SetMessageBody](MailComposerSetMessageBody.md)"; PlaceHolder::Body ; Position ( PlaceHolder::Body ; "&lt;html&gt;" ; 1 ; 1 ) &gt; 0 ) \]   
End If  
If \[ Length ( PlaceHolder::CCRecipients ) &gt; 0 \]   
 Set Variable \[ $r ; Value: MBS ( "[MailComposer.SetCCRecipients](MailComposerSetCCRecipients.md)"; PlaceHolder::CCRecipients ) \]   
End If  
If \[ Length ( PlaceHolder::BCCRecipients ) &gt; 0 \]   
 Set Variable \[ $r ; Value: MBS ( "[MailComposer.SetBCCRecipients](MailComposerSetBCCRecipients.md)"; PlaceHolder::BCCRecipients ) \]   
End If  
If \[ Length ( PlaceHolder::TORecipients ) &gt; 0 \]   
 Set Variable \[ $r ; Value: MBS ( "[MailComposer.SetTORecipients](MailComposerSetTORecipients.md)"; PlaceHolder::TORecipients ) \]   
End If  
Perform Script \[ “AddAttachment” ; Parameter: GetFieldName ( PlaceHolder::Attachment1 ) \]  
Perform Script \[ “AddAttachment” ; Parameter: GetFieldName ( PlaceHolder::Attachment2 ) \]  
Perform Script \[ “AddAttachment” ; Parameter: GetFieldName ( PlaceHolder::Attachment3 ) \]  
Set Variable \[ $r ; Value: MBS ( "MailComposer.Present") \]  
### See also

- [MailComposer.IsPresented](MailComposerIsPresented.md)
- [MailComposer.New](MailComposerNew.md)
- [MailComposer.Result](MailComposerResult.md)
- [MailComposer.SetBCCRecipients](MailComposerSetBCCRecipients.md)
- [MailComposer.SetCCRecipients](MailComposerSetCCRecipients.md)
- [MailComposer.SetMessageBody](MailComposerSetMessageBody.md)
- [MailComposer.SetScript](MailComposerSetScript.md)
- [MailComposer.SetTORecipients](MailComposerSetTORecipients.md)
- [MessageComposer.Present](MessageComposerPresent.md)
- [SocialComposer.Present](SocialComposerPresent.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 checks for a license.

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

  
[MailComposer.New](MailComposerNew.md) - [MailComposer.Result](MailComposerResult.md)

[HTML Version](MailComposerPresent.shtml)