Read emails from exchange online (Office 365) through windows forms application

Prasad De Silva picture Prasad De Silva · Jul 30, 2015 · Viewed 26.1k times · Source

I am trying to read emails from my O365 mailbox through a windows forms application. I want my application to read emails from O365 mailbox using my username and password. Is it possible to access the O365 api without registering the application on the Azure? (only using user credentials)

I followed this article on msdn, https://msdn.microsoft.com/en-us/library/office/dn567668(v=exchg.150).aspx I have an issue in this line:

result = context.AcquireToken(resourceId, ClientID, _returnUri); // parameters are no longer valid in this method

Answer

Matt picture Matt · Jul 30, 2015

Yes, you can do with with Exchange web service API. It is designed for client application. Follow the link, you can find a lot of examples.

One note is: to create the service client, you need specify the version of the Exchange Server, it should be ExchangeVersion.Exchange2013_SP1 for exchange online.

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013_SP1);