2014-06-12 4 views

답변

1

사용 MFMailComposeViewControllerDelegate (https://developer.apple.com/library/ios/documentation/MessageUI/Reference/MFMailComposeViewControllerDelegate_protocol/Reference/Reference.html)

-(void)sendMail 
{ 
    MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init]; 
    [mailer setMailComposeDelegate:self]; 
    //do the rest of the mail composing 
    ... 
} 

-(void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
{ 
    //don't forget to dismiss the controller 
    [controller dismissModalViewControllerAnimated:YES]; 

    if(result == MFMailComposeResultSent) 
    { 
    //the user sent the mail 
    } 
}