【问题标题】:MFMailComposeViewController sending statusMFMailComposeViewController 发送状态
【发布时间】:2013-02-13 05:08:07
【问题描述】:

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

【问题讨论】:

    标签: ios mfmailcomposeviewcontroller


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:
      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;
          }
      
      }
      

      【讨论】:

      • 除非我弄错了,否则问题是关于在收到MFMailComposeResultSent 结果后获取电子邮件的状态。
      猜你喜欢
      • 2011-03-24
      • 1970-01-01
      • 2017-03-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多