We use Limilabs' Mail.dll. We were using the BestLogin method till now to connect with office 365 but as Microsoft office is switching to OAuth2 we need to use the OAuth2 method to connect. I tried to use LoginOAUTH2() method of the Mail DLL but it gives ImapResponseException with an error AUTHENTICATION FAILED.
I am passing Access Token which is received using "https://login.microsoftonline.com/" + {pstrOffice365TenantID} + "/oauth2/v2.0/token" with grant type - client_credentials.
Please let me know what is wrong here and why it is not working.