Hi Kenny,
check the documentation for
MFMailComposeViewControllerDelegate
The MailComposeView will automatically integrate the user's address book and will not cause the application to quit.
Of course, your view class must conform to the MFMailComposeViewControllerDelegate. Then create a composer object
Code:
MFMailComposeViewController *sendEmailComposer = [[MFMailComposeViewController alloc] init];
and add predefined text and other options with the following code:
Code:
sendEmailComposer.mailComposeDelegate = self;
[sendEmailComposer setSubject:@"Check this out dude!"];
NSString *emailBody = @"Hi buddy, check this app out in the app store ...";
[sendEmailComposer setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:sendEmailComposer animated:YES];
Don't forget to implement the mailComposeController: delegate method when the user dismisses the composer:
Code:
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
[self dismissModalViewControllerAnimated:YES];
}