3

i'm quite new to MailCore 2 and im having trouble fetching emails from yahoo & hotmail accounts. I can fetch gmail emails with no problem.

Yahoo:

When I try to fetch email from a yahoo account (imap.mail.yahoo.com) I get the following Error:

Error Domain=MCOErrorDomain Code=1 "The operation couldn’t be completed. (MCOErrorDomain error 1.)

I couldn't seem to find a list of error codes so i dont know what this error code means.

With Hotmail accounts you have to use POP3 but i couldn't find a example of how you would fetch emails. I've tried the following Code:

self.popSession = [[MCOPOPSession alloc] init];
self.popSession.hostname = hostname;
self.popSession.port = [port integerValue];
self.popSession.username = username;
self.popSession.password = password;
self.popSession.connectionType = MCOConnectionTypeTLS;

NSLog(@"checking account");


    self.popMessagesFetchOp = [self.popSession fetchMessagesOperation];

    [self.popMessagesFetchOp start:^(NSError *error, NSArray *message ){

     NSLog(@"Error:%@", [error localizedDescription]);
     NSLog(@"POP3 Message Array: %@",message);

}];

I don't receive any errors in the console just a NULL array.

Any help would be much appreciated!

4

0 回答 0