Skip to content

Instantly share code, notes, and snippets.

@mronge
Last active December 17, 2015 08:39
Show Gist options
  • Save mronge/5581549 to your computer and use it in GitHub Desktop.
Save mronge/5581549 to your computer and use it in GitHub Desktop.
MCOIMAPSession *session = [[MCOIMAPSession alloc] init];
session.hostname = @"imap.gmail.com";
session.port = 993;
session.username = @"matt@gmail.com";
session.password = @"password";
session.connectionType = MCOConnectionTypeTLS;
MCOIndexSet *uidSet = [MCOIndexSet indexSetWithRange:MCORangeMake(1,UINT64_MAX)];
MCOIMAPFetchMessagesOperation *fetchOp =
[session fetchMessagesByUIDOperationWithFolder:@"INBOX"
requestKind:MCOIMAPMessagesRequestKindHeaders
uids:uidSet];
[fetchOp start:^(NSError *err, NSArray *msgs, MCOIndexSet *vanished) {
NSLog(@"Fetched all the message headers!.");
}];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment