exchangewebservicesexchange-server-2007

Can't retrieve emails from shared group mailbox using Exchange Web Services Managed API


I'm trying to use Exchange Web Services Managed API to connect to a group mailbox and return the emails from it's inbox. I was able to do so with my personal email account but I have been unsuccessful with the group mailbox. I have access to the Group mailbox in Outlook. I included the code I used to select the email from the group mailbox. I was not sure what the URI should look like so I tried two different formats.
https://server3.mycompany.com which returned the following error.

The request failed. The remote server returned an error: (405) Method Not Allowed.

and https://server3.mycompany.com/EWS/Exchange.asmx which never returned and timed out.

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.UseDefaultCredentials = true;
\\service.Url = new Uri("https://server3.mycompany.com");
service.Url = new Uri(@"https://server3.mycompany.com/EWS/Exchange.asmx");
Mailbox gpmailbox = new Mailbox("CouponInterfacePool@mycompany.com");
FolderId gpInbox = new FolderId(WellKnownFolderName.Inbox, gpmailbox);
ItemView view = new ItemView(10);
FindItemsResults<Item> results = service.FindItems(gpInbox, view);

Solution

  • To figure out your company's URI

    In the Results tab you'll find the URI on Availability Service URL.