7

Hi I want to access the email of mailbox which is assign to me but it is not my primary mailbox in my Exchange Server.

I was able to get details of the mailbox server which is assigned to me, but I have a user which doesn't have a mailbox.

I want to know how to access that.

I read something related to Impersonation or delegation.

This is not working as the new user doesn't have primary mail.

  • How can I get how many mailbox assign to the user?
  • How can I get particular mailbox email for a user?

I was able to access my mailbox, but when I am trying to access the mailbox for user which doesn't have primary mailbox to it, I am not able to get.

 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);

What can i do?

Jeremy Thompson
  • 52,213
  • 20
  • 153
  • 256
Himanshu sharma
  • 5,735
  • 4
  • 36
  • 58

1 Answers1

0

Well, I found an interesting solution to this issue using Independentsoft.Exchange. Link here. and below is the code

 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);

Hope this helps

Prany
  • 1,834
  • 1
  • 9
  • 20