Open kumarkrish85 opened 4 months ago
One of the 2 below usually works, I am not sure if you deleted or you did not give hostname in code above (i.e. imap.*****.com). Also check the ports, which are used for IMAP TLS or SSL.
if (config.getIMAPSSL().equals("SSL")){
session.hostname = config.getIMAPServer()
session.username = config.getUserName()
session.password = config.getPassword()
session.port = UInt32.parseUInt32(config.getIMAPport())
session.allowsFolderConcurrentAccessEnabled = true
session.connectionType = MCOConnectionType.TLS
session.authType = MCOAuthType.saslLogin
session.isCheckCertificateEnabled = false
session.isVoIPEnabled = false
session.maximumConnections = 2
session.timeout = App.connectionTimeout
} else {
session.hostname = config.getIMAPServer()
session.username = config.getUserName()
session.password = config.getPassword()
session.port = UInt32.parseUInt32(config.getIMAPport())
session.allowsFolderConcurrentAccessEnabled = true
session.connectionType = MCOConnectionType.startTLS
session.authType = MCOAuthType.saslPlain
session.isCheckCertificateEnabled = false
session.isVoIPEnabled = false
session.maximumConnections = 2
session.timeout = App.connectionTimeout
}
if let loginOperation = session.checkAccountOperation() {
do { try await loginOperation.start(); print("imapConnect - Successful IMAP connection") }
catch { print("imapConnect - IMAP Connect Error: \(error)"); return }
}
@Be-Maps Thanks for the reply. I didn't give the hostname in the query for masking. I will try your suggestion and get back
Summary Hello I am trying to connect my company mail server to fetch mail, but i am trying to make a connection to server using the below code, but nothing it get printed , please guide me. I can connect the same server through python imap library
Platform(s) IOS
Happens on Mail Server Outlook365
Piece of code
Actual outcome It didn't print anything
Connection Logs
Expected outcome Mailcore should connect my mail server successfully