MailComposer.CanSendMail
------------------------

Whether emails can be send.

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

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

none

### Result

Returns 1, 0 or error.

### Description

Whether emails can be send.  
Returns 1 if the user has set up the device for sending email.  
  
The client may continue to set the recipients and content if the return value was 1. If 0 was the result, the client has a couple options. It may choose to simply notify the user of the inability to send mail, or it may issue a "mailto" URL via Open URL.  
  
This function can be called before having a composer initialized.  
### Examples

Checks whether we can email:

 Set Variable \[ $r ; Value: MBS ( "MailComposer.CanSendMail" ) \]   
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  
### See also

- [MailComposer.Present](MailComposerPresent.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 18th June 2017

  
[MailComposer.AddAttachmentText](MailComposerAddAttachmentText.md) - [MailComposer.Dismiss](MailComposerDismiss.md)

[HTML Version](MailComposerCanSendMail.shtml)