Platforms to show: All Mac Windows Linux Cross-Platform
MFMailComposeViewControllerMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Messages | MBS iOS Plugin | 24.2 | ❌ No | ❌ No | ❌ No | ✅ Yes | iOS only |
Use this view controller to display a standard email interface inside your app. Before presenting the interface, populate the fields with initial values for the subject, email recipients, body text, and attachments of the email. After presenting the interface, the person can edit your initial values before sending the email.
The composition interface doesn’t guarantee the delivery of your email message; it only lets you construct the initial message and present it for user approval. The person may opt to cancel the composition interface which discards the message and its contents. If the person opts to send the message, the message queues in the user’s Mail app outbox. The Mail app is ultimately responsible for sending the message.
An alternate way to compose emails is to create and open a URL that uses the mailto scheme. URLs of that type go directly to the built-in Mail app, which uses your URL to configure a message. For information about the structure of mailto URLs, see Apple URL Scheme Reference.
- 2 events
- event didFinishWithResult(result as Integer, error as NSErrorMBS)
- event dismissed
- 6 properties
- property Handle as Integer
- property isBeingPresented as Boolean
- property isHTML as Boolean
- property messageBody as String
- property preferredSendingEmailAddress as String
- property subject as String
- 9 methods
- method addAttachmentData(attachment as MemoryBlock, mimeType as String, fileName as String)
- method Constructor
- method Destructor
- method Dismiss
- method Present
- method setBccRecipients(bccRecipients() as String)
- method setCcRecipients(ccRecipients() as String)
- method setMessageBody(body as String, isHTML as Boolean)
- method setToRecipients(toRecipients() as String)
- 2 shared methods
- shared method canSendMail as Boolean
- shared method MFMailComposeErrorDomain as String
- 6 constants
Error Codes
Constant | Value | Description |
---|---|---|
MailComposeErrorCodeSaveFailed | 0 |
An error occurred while trying to save the email message to the Drafts folder. |
MailComposeErrorCodeSendFailed | 1 |
An error occurred while trying to queue or send the email message. |
Result Codes
Constant | Value | Description |
---|---|---|
MailComposeResultCancelled | 0 |
The user canceled the operation. |
MailComposeResultFailed | 3 |
The email message was not saved or queued, possibly due to an error. |
MailComposeResultSaved | 1 |
The email message was saved in the user’s drafts folder. |
MailComposeResultSent | 2 |
The email message was queued in the user’s outbox. |
This class has no sub classes.
Blog Entries
- News from the MBS Xojo Plugins Version 24.2
- MonkeyBread Software Releases the MBS Xojo Plugins in version 24.2
- Send email message in iOS Xojo App
- MBS Xojo Plugins, version 24.2pr2
- MBS Xojo Plugins, version 24.2pr1
Release notes
- Version 24.2
- Added MFMailComposeViewControllerMBS class to let user write an email message.
Some examples using this class:
Some related classes:
The items on this page are in the following plugins: MBS iOS Plugin.
MemoryStorageMBS - MFMessageComposeViewControllerMBS
