1

I'm developing an intranet webpage for coorparation(I use windows authentication). Via this website users can see their mailbox. For this, I use EWS and everything works perfect on IISExpress. However when I publish to IIS server(which is on my computer) it gives this 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".

CODE:

    ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
    service.UseDefaultCredentials = true; 
    service.AutodiscoverUrl("user@xx.com");
    SearchFilter sf = new SearchFilter.SearchFilterCollection(LogicalOperator.And, new SearchFilter.IsEqualTo(EmailMessageSchema.IsRead, false));
    ItemView view = new ItemView(100);

    FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, sf, view);

What can be wrong,I'm looking for days but I couldn't find a solution?

Cembora
  • 244
  • 2
  • 15

0 Answers0