-1

我正在从 iphone 应用程序发送电子邮件,我希望当用户单击电子邮件的发送按钮之后,它应该调用 test() 方法任何想法如何做到这一点,我正在使用以下代码。

NSString * emailBody =@"<html><body>Thank you for your participation in Consulting<br>Practitioner and Client Program.</br><br>Attached is the copy of your signed contract for your records<p>Please email or fax your completed W-9 form to<br>our PEI Support Team<br>Email:PEISupportServices@zoetis.com<br>Fax:800-741-1310<body></html>";



[picker setMessageBody:emailBody isHTML:YES];





[self.navigationController presentViewController:picker animated:YES completion:nil];




}

}


 [self test];    

}

4

1 回答 1

0

请尝试实现这个委托方法?在用户退出作曲家后调用它。

    - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error  {   
    NSString *message = @"";
    // Notifies users about errors associated with the interface
    switch (result) {
        case MFMailComposeResultCancelled:
            message = @"Mail: canceled";
            break;
        case MFMailComposeResultSaved:
            message = @"Mail: saved";
            break;
        case MFMailComposeResultSent:
            message = @"Mail: sent";
//------- call your test method here 
            break;
        case MFMailComposeResultFailed:
            message = @"Mail: failed";
            break;
        default:
            message = @"Mail: not sent";
            break;
    }
    [self dismissModalViewControllerAnimated:YES];
    }
于 2013-06-01T08:01:31.537 回答