Setting up send/receive emails with OAuth 2.0 with MS Graph

Community Alums
Not applicable

Hello,

I am in process of setting up send / receive emails from ServiceNow using OAuth 2.0 IMAP and SMTP. I have set Application registry with Client ID, client secret, authorization and token URLs. I am using IMAP.AccessAsUser.All, SMTP.Send and offline_access entity scopes with Authorization Code as default Grant type. We are using our own mail server to send/receive emails which is on MS/Exchange/Azure with Graph API. The three scopes I have listed are also set on Azure application. 

I have two separate email accounts each for IMAP and SMTP. I am using one entity profile for both accounts and the three entity scopes are set in this one default profile.

After completing all setup on both sides I was able to get Refresh and Access tokens in ServiceNow. However I have following issues 

1) When I click on Test Connection for SMTP account I get Connection Successful message however outbound emails in ServiceNow are sitting in as type of send-retry. It looks like ServiceNow is sending emails to Exchange server however Exchange is not accepting the emails.

2) For IMAP account when I click on Test Connection I get "Read Timed Out" error after 4-5 minutes.

Has anyone successfully set OAuth 2.0 with MS Graph API? What would be cause of issues for items 1 and 2 above?

Let me know if you need any other additional details.

thanks

Samir

1 REPLY 1

Michael255
Kilo Sage

Hi Samir,

I was wondering if you resolved your issue and the cause was? We are having a similar issue with our set up.