My IMAP code to check emails at Office 365 just stopped working last fall (client didn't notice until just recently).
This is my code. It dies at the login:
Chilkat.Global glob = new Chilkat.Global();
var success = glob.UnlockBundle("MyUnlockCode");
if (success != true)
{
log.LogError("ProcessLatestEmails. Error unlocking component: " + imap.LastErrorText);
return false;
}
// To use a secure TLS/SSL connection, set the Ssl property and the port:
imap.Ssl = UseSSL;
imap.Port = Port;
success = imap.Connect(Server);
if (success != true)
{
log.LogError("ProcessLatestEmails. Error connecting to server: " + imap.LastErrorText);
return false;
}
success = imap.Login(UserName, Password);
if (success != true)
{
log.LogError("ProcessLatestEmails. Error logging in: " + imap.LastErrorText);
imap.Disconnect();
imap.Dispose();
return false;
}
This is error that is returned:
ProcessLatestEmails. Error logging in: ChilkatLog:
Login:
DllDate: Dec 29 2022
ChilkatVersion: 9.5.0.93
UnlockPrefix: UnlockCodeWasHere
Architecture: Little Endian; 64-bit
VerboseLogging: 0
imapServer: outlook.office365.com
loginX(2797ms):
login: adam@clientdomain.com
greeting: * OK The Microsoft Exchange IMAP4 service is ready. [QgBZAEEAUABSADIAMgBvAGQALgBv...AHUAdABsAG8AbwBrAC4AYwBvAG0A]authenticateLogin(2797ms):
loginImap(2797ms):
ConnectionType: SSL/TLS
ImapCmdSent: aaab LOGIN "adam@clientdomain.com"
getCompleteResponse(2797ms):
ImapCmdResp: aaab NO LOGIN failed.
--getCompleteResponse
--loginImap
isOK: serverResponse: aaab NO LOGIN failed.
--isOK
--authenticateLogin
--loginX
Failed.
--Login
--ChilkatLog
I verified that IMAP is still enabled for all accounts. I also verified that the passwords are correct.
Is this a deprecated pattern and I need to figure out OAuth or can I get it working.
I am using ChilkatDnCore31 v9.5.0.93 and running this is an Azure Functions instance.