My iPhone app is using the MFMailComposeViewController class to send an in-app email with an attachment.
The app will only attempt to display the mail composer dialog if the "canSendMail" method of class MFMailComposeViewController returns true (YES). Specifically, if the following method returns YES, it shows the mail composer, otherwise the user is presented with an error alert dialog stating that there are no email accounts set up on the device:
Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
return mailClass != nil && [mailClass canSendMail];
If at least one email account is enabled on the device, the following call should return YES:
Conversely, if all accounts are disabled/removed, it will return NO.