views:

1446

answers:

2

Hi,

I am involved in writing a little internal SharePoint portal for our company. I thought it would be a 'quick win' to get create a web part that would display the user's unread mail count, and possibly a list of today's calendar tasks. However, I have had a hunt around for information to do with OWA web services stuff and I can see no easy way of doing this.

Am I being stupid, is there a simple call you can make? If not what would my first steps be in order to achieve what I want?

Thanks!

+2  A: 

A few months ago I have done this using CDO Library with C# .NET Windows Service.Example code was like this

            MAPI.Folder inboxFolder = Inbox;
            MAPI.Messages messages = (Messages) inboxFolder.Messages;
            MAPI.MessageFilter filter = (MessageFilter) messages.Filter;
            filter.Unread = true;
mcaaltuntas
Using CDO (either the client/Outlook or the server/Exchange versions) from .Net is not supported by Microsoft as can be seen respectively at http://support.microsoft.com/default.aspx/kb/872895 and http://support.microsoft.com/kb/813349/ for the reasons described at http://blogs.msdn.com/stephen_griffin/archive/2009/04/03/mapi-and-net.aspx
Alfred Myers
+1  A: 

If they're using Exchange 2007, you can use Exchange web services to query the inbox.

Here's the reference in MSDN. The FindFolder operation will return the unread count of a folder. http://msdn.microsoft.com/en-us/library/bb204119.aspx

Visual Studio can generate the proxy classes for you to help you get started: http://msdn.microsoft.com/en-us/library/bb408522.aspx

Jesse Weigert
Complementing Jesse’s answer, in December 2009, Microsoft released EWS Managed API 1.0 (http://msdn.microsoft.com/en-us/library/dd633709(EXCHG.80).aspx) - a better alternative than auto-generated proxy classes for accessing EWS from .Net clients.
Alfred Myers
Thanks! This library makes it much easier to use the API.
Jesse Weigert