Ios 通过MailCore连接到google apps服务器时出现问题
我正在尝试通过IMAP连接到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"
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
,因为第二个选项会使服务器崩溃