MailCore / MailCore2 library not loaded - Failed IPv6 compatibility - Swift

285 Views Asked by At

Frameworks screenshot

Error notes screenshot

My app is using SMTP via the MailCore framework to send information to a gmail account. It has been rejected due to incompatibility with IPv6. In the crash notes from apple, it states "Could not load library MailCore". Github states that the MailCore2 framework is already compatible with IPv6, so I am not sure what the issue is.

I resubmitted after adding MailCore.framework into the "Embedded Binaries" section but am not sure this will fix this issue.

I have attached screenshots to help clarify. Thanks for any help!

Code:

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)")
1

There are 1 best solutions below

0
Charles Xavier On

This should work. I've also created a video to assist anyone else in the future: https://www.youtube.com/watch?v=NkpLqNN8xtU

 let smtpSession = MCOSMTPSession()
        smtpSession.hostname = "smtp.gmail.com"
        smtpSession.username = "[email protected]"
        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)")
                }
            }
        }