如何在两个不同的电子邮件ID范围内获取电子邮件标头 - Mailcore

时间:2018-05-28 11:53:38

标签: ios swift mailcore2 mailcore

假设我有两个不同的电子邮件ID。 111和115

现在我想在这两个id的范围之间获取电子邮件。

以前我使用以下方法获取电子邮件列表。

/**  Returns an operation to fetch messages by (sequence) number.  For example: show 50 most recent uids.
     NSString *folder = @"INBOX";
     MCOIMAPFolderInfoOperation *folderInfo = [session folderInfoOperation:folder];

     [folderInfo start:^(NSError *error, MCOIMAPFolderInfo *info) {
         int numberOfMessages = 50;
         numberOfMessages -= 1;
         MCOIndexSet *numbers = [MCOIndexSet indexSetWithRange:MCORangeMake([info messageCount] - numberOfMessages, numberOfMessages)];

         MCOIMAPFetchMessagesOperation *fetchOperation = [session fetchMessagesByNumberOperationWithFolder:folder
                                                                                               requestKind:MCOIMAPMessagesRequestKindUid
                                                                                                   numbers:numbers];

         [fetchOperation start:^(NSError *error, NSArray *messages, MCOIndexSet *vanishedMessages) {
             for (MCOIMAPMessage * message in messages) {
                 NSLog(@"%u", [message uid]);
             }
         }];
     }];
*/

0 个答案:

没有答案