0

有没有办法从 MFMailComposeViewController 获取状态?假设我正在发送一封包含 20 张图片的电子邮件,我想显示一些加载,然后在发送完成后隐藏加载。

4

2 回答 2

1

不会。一旦用户选择发送电子邮件并且在您的应用程序中调用了委托方法,该电子邮件就会在发件箱中等待某个后台邮件守护程序发送。没有 API 可以获取此类电子邮件的状态。即使由于某种原因无法发送邮件,应用程序也无法获取此信息。

于 2013-02-12T21:02:24.547 回答
-1
try the delegate methods may be it help you.


#pragma mark - MailComposeController

- (void)mailComposeController:(MFMailComposeViewController*)controller  didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
    switch (result)
    {
        case MFMailComposeResultCancelled:
            NSLog(@"Mail cancelled: you cancelled the operation and no email message was queued.");
            break;
        case MFMailComposeResultSaved:
            NSLog(@"Mail saved: you saved the email message in the drafts folder.");
            break;
        case MFMailComposeResultSent:
            NSLog(@"Mail send: the email message is queued in the outbox. It is ready to send.");
            break;
        case MFMailComposeResultFailed:
            NSLog(@"Mail failed: the email message was not saved or queued, possibly due to an error.");
            break;
        default:
            NSLog(@"Mail not sent.");
            break;
    }

}
于 2013-02-12T21:08:07.300 回答