【发布时间】:2016-10-17 14:30:16
【问题描述】:
我能够创建一个进程邮箱并且我能够通过 https://ExchangeServer/owa/processmailbox@domain.com 然后我将提供我的凭据,然后我就可以登录了。
但我无法通过 EWS 访问。它说 SMTP 地址没有与之关联的邮箱。
我可以使用相同的代码访问我的收件箱..
【问题讨论】:
标签: c# exchange-server exchangewebservices
我能够创建一个进程邮箱并且我能够通过 https://ExchangeServer/owa/processmailbox@domain.com 然后我将提供我的凭据,然后我就可以登录了。
但我无法通过 EWS 访问。它说 SMTP 地址没有与之关联的邮箱。
我可以使用相同的代码访问我的收件箱..
【问题讨论】:
标签: c# exchange-server exchangewebservices
如果您能够通过交换邮件连接到邮箱,那么您应该能够在 EWS 中执行相同的操作。 创建一个服务 (ExchangeService),您可以在其中使用您的交换凭据登录,然后使用该服务连接到邮箱
Mailbox mb = new Mailbox("processmailbox@domain.com");
FolderId fid = new FolderId(WellKnownFolderName.Inbox, mb);
ItemView view = new ItemView(100);
//use your service to get 100 mails from the mailbox
var findResults = service.FindItems(fid, view);
foreach (var item in findResults.Items)
{
var message = EmailMessage.Bind(service, item.Id, new PropertySet(BasePropertySet.FirstClassProperties, ItemSchema.Attachments));
}
【讨论】: