ios - MailCore/MailCore2 库未加载 - IPv6 兼容性失败 - Swift

标签 ios swift frameworks ipv6 mailcore

Frameworks screenshot

Error notes screenshot

我的应用程序通过 MailCore 框架使用 SMTP 将信息发送到 gmail 帐户。由于与 IPv6 不兼容而被拒绝。在苹果的崩溃说明中,它指出“无法加载 MailCore 库”。 Github 指出 MailCore2 框架已经与 IPv6 兼容,所以我不确定问题是什么。

我在将 MailCore.framework 添加到“嵌入式二进制文件”部分后重新提交,但不确定这是否会解决此问题。

我附上了屏幕截图以帮助澄清。感谢您的帮助!

代码:

let smtpSession = MCOSMTPSession()
smtpSession.hostname = "smtp.gmail.com"
smtpSession.username = "sampleUsername"
smtpSession.password = "samplePassword"
smtpSession.port = 465
smtpSession.authType = MCOAuthType.saslPlain
smtpSession.connectionType = MCOConnectionType.TLS
smtpSession.connectionLogger = {(connectionID, type, data) in
    if data != nil {
        if let string = NSString(data: data!, encoding: String.Encoding.utf8.rawValue){
            NSLog("Connectionlogger: \(string)")

最佳答案

这应该有效。我还创建了一个视频以帮助将来的其他人: https://www.youtube.com/watch?v=NkpLqNN8xtU

 let smtpSession = MCOSMTPSession()
        smtpSession.hostname = "smtp.gmail.com"
        smtpSession.username = "charlesxavier1221@gmail.com"
        smtpSession.password = "fakepassword1234"
        smtpSession.port = 465
        smtpSession.authType = MCOAuthType.saslPlain
        smtpSession.connectionType = MCOConnectionType.TLS
        smtpSession.connectionLogger = {(connectionID, type, data) in
            if data != nil {
                if let string = NSString(data: data!, encoding: String.Encoding.utf8.rawValue){
                    NSLog("Connectionlogger: \(string)")
                }
            }
        }

关于ios - MailCore/MailCore2 库未加载 - IPv6 兼容性失败 - Swift,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40119863/

相关文章:

python - Python REST(Web 服务)框架的推荐?

swift - 该服务器的证书无效(错误 : 9813 )

ios - Labels 和 Imageviews 在 iOS7 的自定义单元格中表现异常

ios - 我可以使用我的 iOS 应用程序中提供的默认图像编辑器吗?

ios - 快速调整字体大小以适应静态 UITextView 的宽度和高度

swift - 是否有一个快速数据结构可以包含一个可以是任何类型并且可以切换的rawValue

objective-c - Swift - 在 Objective-C 类中访问 NSArray

css - 一个简单的gumby CSS框架教程

c++ - FreeRTOS(和其他 RTOS'es)也是一个框架吗

iphone - 在 UIViewController 上启用界面方向