The following code gives me an invalid inbox uri exception. I’m running this off my local IIS instance, and I’m using the same exchange credentials and server name as what I used to setup Outlook.
Hi,
Thank you for your inquiry.
Please note that the Exchange Server URI is in format as “[https://exchange.domain.com](https://exchange.domain.com/)”
. I believe you are not adding the “https://” before the Exchange Server address.
Regards,
I don’t think I had the HTTP part on there, I will try again, and let you know.
I have added the HTTPS:// but now I’m getting an SSL/TLS error. Does this need to be an external name? The only address I have for it is an internal address, but this also needs to be deployable so that we can push our product to our clients and they can use this without having to modify their Exchange server settings.
Hi,
Hi again,
We have further investigated your said issue and we think that you are not specifying the Mailbox to access.
You can specify the Mailbox in two ways,
Either you can specify it directly in ExchangeClient constructor like ExchangeClient(“http[s]://server:port/exchange//”, userName, password, domain)
ExchangeClient client = new ExchangeClient(“https://exchange.test.server/exchange/Test1”, userName, password, domain)
Or if you have defined only exchange server in the constructor, you need to specify the mailbox in GetMailboxInfo method.
ExchangeClient client = new ExchangeClient("https://exchange.test.server", userName, password, domain);
ExchangeMailboxInfo mbInfo = client.GetMailboxInfo("Test1");
ExchangeMessageInfoCollection messages = client.ListMessages(mbInfo.InboxUri);
I switched to using the ExchangeWebServiceClient, and now everything is working.