How can I access mails from Shared mailbox using Mailkit

419 Views Asked by At

Recently Microsoft has started to authenticate user with OAuth 2.0 protocol. I have implemented it in Asp.net Core C# and got token.

Now I am able to access mails from main mail Inbox using Mailkit from Microsoft exchange server using OAuth 2.0. But how can I be able to access mails from shared mailbox?

In my code I have mentioned shared mailbox account id.

My code is as follows

Code Getting exception as "Autheticated but not connected". Please guide

2

There are 2 best solutions below

0
Tejas Patel On BEST ANSWER

Need to give shared mailbox permissions to OAuth app as well and shared mailbox will be accessible.

3
jstedfast On

The "Authenticated but not connected" error is unique to Microsoft Exchange IMAP servers and means that your account is not authorized to connect via IMAP.

You will need to be granted permissions for IMAP access by the admin of your tenant.