Get Mailbox and Folder Information From Microsoft Exchange Server Using Exchange Web Services

Hi,

I am testing Exchange Web Services. I manage to connect to my Exchange server in this demo:

[http://www.aspose.com/demos/.net-components/aspose.email/csharp/exchange-ews/Exchange-Server-Connect-EWS.aspx ](http://www.aspose.com/demos/.net-components/aspose.email/csharp/exchange-ews/Exchange-Server-Connect-EWS.aspx)

In this demo the user and password can be anything and it still works - am I right?

But when I try to get mailbox and folder information in this demo:

[http://www.aspose.com/demos/.net-components/aspose.email/csharp/exchange-ews/Exchange-Server-Mailbox-Folder-Information-EWS.aspx ](http://www.aspose.com/demos/.net-components/aspose.email/csharp/exchange-ews/Exchange-Server-Mailbox-Folder-Information-EWS.aspx)

I get an exception saying

Object Moved

This document may be found [here ](https://owa.ilait.se/owa)
–.

and I am redirected to my Office Outlook Webaccess. Why is that? The user and password works fine here so it should be correct.

About the domain entry - my provider says that this should be left empty but I can’t in the demo. Can I write anything then?

Best regards
Robert Tell

Hi Robert,

Thank you for considering Aspose.

Can you please provide the Exchange Server Address that you are providing to retrieve the MailBox and Folder information from?

Please note that the Exchange Server Address will be in a format as given below,

**http://exchange-server-address/ews/Exchange.asmx**

You can provide the exchange-server-address portion from the above URL as your Domain. In your case it will probably be “ilait.se”.

Please test the demo with correct Exchange Server Address and valid credentials and let us know of your results.

Hi,

I have attached three images. The first is from the Demo and the second and the third is from my Exchange provider. Please tell me where I go wrong.

Best regards

Robert Tell

Hi Robert,


I still suspect that either the Exchange Server Address or your Domain is wrong. I have tried the same demo page with Aspose Exchange Server and I am able to enlist the messages from my mailbox.

Please change the Domain to rtsolutions.se and try again.

Thank you for your co-operation

Hi,

I sent a request to try your demo to my exchange provider and they responded like this:

I’m afraid I can’t see what the problem is either. I couldn’t get it to work.

I tried to connect and login manually from my computer to https://owa.ilait.se/ews/Exchange.asmx and that worked without a problem, so I’m not sure what Aspose are doing differently.

Do you know what could be the problem?

Best regards

Robert Tell

Hi Robert,

I have put together a working example comprising of same source code used in below linked live demo.

http://www.aspose.com/demos/.net-components/aspose.email/csharp/exchange-ews/Exchange-Server-Mailbox-Folder-Information-EWS.aspx

Please download the attached Visual Studio 2008 project in an archive. You need to place the Aspose.Email for .NET assembly in Bin folder. Also, specify your Exchange Server URL and credentials in source code. You can leave the Domain as empty string and test if this works for you.

Thanks and Regards,

Hi Babar,

Thanks for the project - it works fine with the domain blank. I have another question though. I notice that it takes a very long time to fetch all the messages from the inbox (for instance) and I wonder if there is a convenient way to store all the messages the first time (in for instance my SQL database) and after that only get the new messages - the same way the Outlook does it. Maybe you have an example on this in your site. I looked but didn’t seem to find anything.

Best regards
Robert Tell

Hi Robert,


Good to know that your issue is resolved.

Regarding your other question. I am afraid, currently there is no such way to get multiple messages in a single call.

I will discuss this with the development team and if any performance issue is found, then we might optimize this.