Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Connecting to iCloud doesn't seem to work #72

Closed
anthonycastelli opened this Issue Feb 16, 2013 · 1 comment

Comments

Projects
None yet
1 participant

I'm following these guides from APple to connect to the iCloud mail server http://support.apple.com/kb/ht4864.

When I try to connect to the server on iOS using

BOOL success = [account connectToServer:@"imap.mail.me.com"
                                           port:993
                                 connectionType:CTConnectionTypePlain
                                       authType:CTImapAuthTypePlain
                                          login:@"myEmail@me.com"
                                       password:@"myPassword"];

It does nothing. No error or anything. The UI is still responsive but nothing happens. When I send a message like this, everything works fine:

    CTCoreMessage *testMsg = [[CTCoreMessage alloc] init];
    [testMsg setTo:[NSSet setWithObject:[CTCoreAddress addressWithName:@"Anthony" email:@"myEmail@me.com"]]];
    [testMsg setFrom:[NSSet setWithObject:[CTCoreAddress addressWithName:@"Anthony" email:@"email@server.com"]]];
    [testMsg setBody:@"This is a test message!"];
    [testMsg setSubject:@"This is a subject"];

    NSError *error;
    BOOL success = [CTSMTPConnection sendMessage:testMsg
                                          server:@"smtp.mail.me.com"
                                        username:@"myEmail@me.com"
                                        password:@"myPassword"
                                            port:587
                                  connectionType:CTSMTPConnectionTypeStartTLS
                                         useAuth:YES
                                           error:&error];
    if (!success) {
        // Present the error
    }

Am I doing something wrong trying to download the messages or does it just not work?

I figured it out, iCloud requires the CTConnectionTypeTLS instead of the plain type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment