简体   繁体   English

如何使用 Mailkit 从共享邮箱访问邮件

[英]How can I access mails from Shared mailbox using Mailkit

Recently Microsoft has started to authenticate user with OAuth 2.0 protocol.最近 Microsoft 开始使用 OAuth 2.0 协议对用户进行身份验证。 I have implemented it in Asp.net Core C# and got token.我已经在 Asp.net Core C# 中实现了它并获得了令牌。

Now I am able to access mails from main mail Inbox using Mailkit from Microsoft exchange server using OAuth 2.0.现在,我可以使用 OAuth 2.0 从 Microsoft 交换服务器使用 Mailkit 从主邮件收件箱访问邮件。 But how can I be able to access mails from shared mailbox?但是我怎样才能从共享邮箱访问邮件呢?

In my code I have mentioned shared mailbox account id.在我的代码中,我提到了共享邮箱帐户 ID。

My code is as follows我的代码如下

Code Getting exception as " Autheticated but not connected ".代码获取异常为“已验证但未连接”。 Please guide请指导

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. “已验证但未连接”错误是 Microsoft Exchange IMAP 服务器特有的,表示您的帐户未获得通过 IMAP 连接的授权。

You will need to be granted permissions for IMAP access by the admin of your tenant.您需要获得租户管理员授予的 IMAP 访问权限。

Need to give shared mailbox permissions to OAuth app as well and shared mailbox will be accessible.还需要为 OAuth 应用程序提供共享邮箱权限,共享邮箱才能访问。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM