EWS managed api read emails for process mailbox with service account

Hi,

I have setup a process mailbox account on exchange and added service account with editfor permissions.

When I try to call service.FindItems using C# managed api I am getting the following error;

When making a request as an account that does not have a mailbox, you must specify the mailbox primary SMTP address for any distinguished folder Ids.

Any ideas?

I am creating the exchange service instance with the NetworkCredential of the service account.

Am I missing something obvious?

Thanks

June 10th, 2015 9:48am

Since you're logging on as the service account, you have to tell EWS which mailbox you want to access. Instead of using the WellKnownFolderName enum directly, you would create a new instance of the FolderId class, passing the SMTP address of the target mailbox, like so:

new FolderId(WellKnownFolderName.Inbox, "targetmailbox@contoso.com");

See https://msdn.microsoft.com/EN-US/library/office/dn641957(v=exchg.150).aspx#bk_explicitewsma for details.

Free Windows Admin Tool Kit Click here and download it now
June 10th, 2015 10:06am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics