We are having trouble connecting to outlook.office365.com with OAuth2.0.
After getting a valid accessToken we do this:
lMailServer.Server = 'outlook.office365.com'
lMailServer.Port = '443'
lMailServer.User = '[our username]'
lMailServer.Password = accessToken
lMailServer.Protocol = 2 // EWS
lMailServer.SSLConnection = TRUE
lMailServer.AuthType = 3 // OAuth
lMailServer.Alias = "[email address]"
lmailClient.Connect(lMailServer)
Last line fails with "Unknown error 500".
My concern is that despite the authtype being set to 3 the log file shows this:
Server: outlook.office365.com
Port: 443
AuthType: AuthLogin
SSLConnection: True
SSLType: ConnectSSLAuto
Protocol: Exchange Web Service
ProxyProtocol: Socks5