18
May
2021
Send mail in SwiftUI
Reading time: 2 min
This recipe shows how to send mail from SwiftUI. You'll build a MailView
by wrapping MessageUI's MFMailComposeViewController
in a UIViewControllerRepresentable
. You'll be able to:
- Determine if you can send mail or not.
- Pass subject, message and recipients to the view via a binding.
- Attach files to the email.
- Receive success or failure result after sending the email.