How to send an email in iOS

This is tricky but doable. We’re using the MFMailComposeViewController protocol for this (don’t ask). This will open the mail app on your device. Older devices without mail sending capability will crash when you call this method so we’ll check before we do this.

For this action to work the View Controller calling it needs to confirm to the MFMailComposeViewController protocol so we need to set this in our ViewController.h file. We also need to import the MessageUI Framework:

Don’t forget to add the framework itself via Build Phases (explained next).

About Jay Versluis

Jay is a medical miracle known as a Super Survivor. He runs two YouTube channels, five websites and several podcast feeds. To see what else he's up to, and to support him on his mission to make the world a better place, check out his Patreon Campaign.

Add your voice!