Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/mongodb/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 通过MailCore连接到google apps服务器时出现问题_Ios_Mailcore - Fatal编程技术网

Ios 通过MailCore连接到google apps服务器时出现问题

Ios 通过MailCore连接到google apps服务器时出现问题,ios,mailcore,Ios,Mailcore,我正在尝试通过IMAP连接到Google Apps电子邮件服务器。我在下面使用的代码,每次尝试连接时都会出现错误:Parse error有人知道此错误的来源吗 int port = 993; CTCoreAccount *account = [[CTCoreAccount alloc] init]; BOOL success = [account connectToServer:@"imap.gmail.com"

我正在尝试通过IMAP连接到Google Apps电子邮件服务器。我在下面使用的代码,每次尝试连接时都会出现错误:
Parse error
有人知道此错误的来源吗

    int port = 993;
    CTCoreAccount *account = [[CTCoreAccount alloc] init];
    BOOL success = [account  connectToServer:@"imap.gmail.com"
                                        port:port
                              connectionType:CTConnectionTypeStartTLS
                                    authType:CTImapAuthTypePlain
                                       login:login
                                    password:password];
    NSLog(@"Port: %d",port);
    if (!success) {
        NSLog(@"Connection failed, error: %@",[account.lastError localizedDescription]);
    }
    else {
        NSLog(@"Connection succeeded");
    }

这里同时发生了两个问题。首先,我的网络有一个防火墙,这就是
解析错误的根源

其次,当您需要连接到Google Maps IMAP服务器时,您需要使用
CTConnectionTypeTLS
而不是
CTConnectionTypeStartTLS
,因为第二个选项会使服务器崩溃