(Objective-C) Retrieve UIDL's from POP3 Server
Retrieve a list of UIDLs from a POP3 server. A UIDL is an identifier consisting of 1 to 70 characters in the range 0x21 to 0x7E, which uniquely identifies a messages within a mailbox and persists across sessions.
#import <CkoMailMan.h>
#import <CkoStringArray.h>
#import <NSString.h>
// This example requires the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
CkoMailMan *mailman = [[CkoMailMan alloc] init];
mailman.MailHost = @"pop.example.com";
mailman.PopUsername = @"myLogin";
mailman.PopPassword = @"myPassword";
mailman.MailPort = [NSNumber numberWithInt:995];
mailman.PopSsl = YES;
CkoStringArray *sa = [mailman GetUidls];
if (mailman.LastMethodSuccess == NO) {
NSLog(@"%@",mailman.LastErrorText);
return;
}
// Download each email by UIDL.
NSString *uidl = 0;
int i = 0;
int numUidls = [sa.Count intValue];
while (i < numUidls) {
uidl = [sa GetString: [NSNumber numberWithInt: i]];
NSLog(@"%@",uidl);
i = i + 1;
}
|