iPhone not returning to application after calling eMail send

Posted by Bill on Stack Overflow See other posts from Stack Overflow or by Bill
Published on 2010-06-05T23:19:17Z Indexed on 2010/06/05 23:22 UTC
Read the original article Hit count: 275

Filed under:
|

I am sending an email from within my iPhone application. The eMail page pops up ok, I click on the Send button, the iPhone plays a whoosh sound, and the eMail actually arrives at the recipient.

Unfortunately, the mail dialog still sits there unresponsive, and the only option - to click the home button - kills the app.

Is there something else that needs to be specified to close the eMailMessage view?

MFMailComposeViewController *eMailMessage;
NSArray *toAddress;

if ([MFMailComposeViewController canSendMail]) {
    toAddress = [NSArray arrayWithObject:@"[email protected]"];
    eMailMessage = [[MFMailComposeViewController alloc] init];
    [eMailMessage setToRecipients:toAddress];
    [eMailMessage setSubject:@"Notification"];
    [eMailMessage setMessageBody:@"Performed by ..." isHTML:NO];
    [self presentModalViewController:eMailMessage animated:YES];
    [eMailMessage release];
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c