0

如果我有一个应用程序可以从应用程序内向用户朋友发送电子邮件或短信,我该如何检查以确保消息已通过并成功发送,或者是否有良好的服务阻碍了消息的成功发送什么不能或不能这样做?

4

1 回答 1

2

要查看从您的应用程序发送电子邮件的结果,您应该实现委托方法mailComposeController:didFinishWithResult:result:error

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
    if (result == MFMailComposeResultSent) {
        // email was sent successfully
    } else if (result == MFMailComposeResultFailed) {
        // email failed to send
        NSLog(@"mail send error: %@", [error localizedDescription]);
    }
}

请务必将您的委托设置MFMailComposeViewControllerself

苹果文档参考这里

当然这只是告诉你邮件是否发送成功。真的没有办法知道电子邮件是在收件人端送达的。

于 2012-03-05T01:17:03.613 回答