您好,我想访问分配给我的邮箱的电子邮件,但它不是我在 Exchange Server 中的主邮箱。
我能够获得分配给我的邮箱服务器的详细信息,但我有一个没有邮箱的用户。
我想知道如何访问它。
我阅读了与模拟或委托(delegate)相关的内容。
这不起作用,因为新用户没有主邮件。
- How can I get how many mailbox assign to the user?
- How can I get particular mailbox email for a user?
我能够访问我的邮箱,但是当我尝试访问没有主邮箱的用户的邮箱时,我无法访问。
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010);
service.Credentials = new WebCredentials("user-name", "password", "domain");
//Autodiscover end point
service.Url = new System.Uri("https://exchange-url/EWS/Exchange.asmx");
FolderId SharedMailbox = new FolderId(WellKnownFolderName.Inbox, "maibox-name");
ItemView itemView = new ItemView(1000);
service.FindItems(SharedMailbox, itemView);
我能做什么?
最佳答案
好吧,我使用 Independentsoft.Exchange 找到了解决此问题的有趣方法。友情链接 here .下面是代码
NetworkCredential credential = new NetworkCredential("username", "password");
Service service = new Service("https://exchange-url/EWS/Exchange.asmx", credential);
Independentsoft.Exchange.Mailbox mailbox = new Independentsoft.Exchange.Mailbox("MysecondEmail@mydomain.com");
StandardFolderId InboxFolder = new StandardFolderId(StandardFolder.Inbox, mailbox);
希望对你有帮助
关于c# - 对于没有默认邮箱的用户(我没有默认邮箱),如何从 Exchange Server 获取邮箱电子邮件详细信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50641933/