gpt4 book ai didi

java - 如何连接到共享邮箱?

转载 作者:行者123 更新时间:2023-12-01 10:08:01 25 4
gpt4 key购买 nike

我可以使用以下代码完美连接到我的邮箱

  Store store = session.getStore("imap");
store.connect(host, user, password);

但每当我尝试连接到共享邮箱时,它都会抛出 javax.mail.AuthenticationFailedException: AUTHENTICATE failed 错误

 store.connect(host, "domainxxx.com" + "\\" + user + "\\" + "shared_mailbox_alias", password); 

我读到一篇文章,仅 2010 版本的 Exchange 支持 domain\user\alias 格式。 我还能如何连接?

我每天在 Outlook 中使用这个共享邮箱,它运行良好,所以我知道它运行良好。

最佳答案

在 JavaMail wiki 上我们有这个 note about Exchange :

To access a shared mailbox in Exchange, you need to login using the "alias" name and password for the shared mailbox, which you can get from your Exchange server administrator. This article has more information.

请注意,Outlook 使用 Microsoft 专有协议(protocol),其工作方式与 IMAP 不同。并非 Exchange 的所有功能都可以通过 IMAP 访问。

关于java - 如何连接到共享邮箱?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36320339/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com