MessageUI provides view controllers for composing and sending email and SMS/MMS messages from within your iOS and visionOS app. Present an MFMailComposeViewController to let people compose and send email, or an MFMessageComposeViewController to compose SMS and MMS messages, and respond to the outcome through MFMailComposeViewControllerDelegate and MFMessageComposeViewControllerDelegate, which report results such as MFMailComposeResult and MessageComposeResult. The framework also includes supporting types for mail drafts and composition, including MFMailDraft and MFComposeAssistantViewController.
Composing Email 3
Present a view controller that lets people compose and send email from within your app.
- ClMFMailComposeViewControlleriOS 3.0+@class MFMailComposeViewController
- PrMFMailComposeViewControllerDelegate@protocol MFMailComposeViewControllerDelegate
- EnMFMailComposeResultiOS 3.0+@enum MFMailComposeResult
Composing Text Messages 3
Present a view controller that lets people compose and send SMS and MMS messages.
- ClMFMessageComposeViewControlleriOS 4.0+@class MFMessageComposeViewController
- PrMFMessageComposeViewControllerDelegate@protocol MFMessageComposeViewControllerDelegate
- EnMessageComposeResultiOS 4.0+@enum MessageComposeResult
Mail Drafts and Composition 4
Supporting types for building mail drafts and integrating the compose-assistant experience.
- ClMFMailDraftAn object that represents an email draft, including its recipients, subject, body, and attachments.
- ClMFComposeAssistantViewControllerA view controller that hosts the compose-assistant experience for drafting messages.
- PrMFComposeAssistantViewControllerDelegateA protocol that handles events from the compose-assistant view controller.
- ClWritingAssistantAn object that assists people in drafting message text during composition.
Results and Errors 2
Values that report the outcome of a composition session and the deferred actions and errors that can occur.
- EnMFMailComposeControllerDeferredActionConstants that specify the action to take after deferring an email composition session.
- StMFMailComposeErroriOS 3.0+A structure that describes errors that occur while composing or sending an email message.