KevinTheJedi
Hey Kevin.
The code changes you did here worked fine, but we also had to apply the scope change of offline_access https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/POP.AccessAsUser.All https://outlook.office.com/SMTP.Send
from jerer (https://forum.osticket.com/d/105728-ms-oauth2-error-the-api-version-v2-has-been-depreciated/12) to make it accept the scopes. With the combined changes, it seems to work as expected with MS365 accounts (business, not personal, addresses).
I will admit this seems like a hacky approach having the changes in the plugin and the scope changes, but otherwise it wouldn't send AND receive properly.