7

I need to replicate the Outlook feature/functionnality to send some tasks requests to someone (see here) but with mails sent from a webserver using ASP.NET C# and without Outlook installed on the webserver (thus using outlook automation is not possible).

I already check what are the possiblities to do this, and it seems a common way to send tasks to someone is to generate an .ics file in iCalendar format, and include that file to the mail (see this stackoverflow question).

It works great, however there is no equivalence of tasks sent by outlook :

  • Events (VEVENT) have a start date and end date (like a task) but no "completion" field (which make sense since it is an event, not a task).
  • Todos (VTODO) have only a due date, no start date or end date and it is not supported by outlook.

I checked myself what Outlook exactly send in a mail containing a task request : It include a winmail.dat file (with content-type:application/ms-tnef) encoded as Base64. Inside that file (which is a binary file) there is a reference to IPM.TaskRequest which seems to be what i need.

I checked the web and found some TNEF parsers, but i need the oposite : to generate from C# code a TNEF file that would contains a task request. I would like to know if there is a way to do that. Using a library (free or not) is not an issue.

Community
  • 1
  • 1
tigrou
  • 4,236
  • 5
  • 33
  • 59

1 Answers1

0

Even if outlook were installed on the web server, outlook automation on a server is generally a bad idea.

However, have you looked at Exchange Web Services? It provides a complete object model to integrate with outlook. Obviously it's tied to outlook (unlike ics), but it does seem to fit your use case.

EWS overview: http://msdn.microsoft.com/en-us/library/exchange/dd877045%28v=exchg.140%29.aspx

Working with tasks: http://blogs.msdn.com/b/dhruvkh/archive/2012/04/06/working-with-tasks-using-exchange-web-services.aspx

jeroenh
  • 26,362
  • 10
  • 73
  • 104
  • Two questions : 1) does it need to have Microsoft Exchange installed ? or is it available as a standalone library that i can add to any C# project ? 2) i see many references to Exchange 2010 and Exchange 2007 in the page you submitted, does this solution work for sending tasks requests to someone who use Outlook 2003 ? – tigrou Nov 19 '12 at 14:13
  • I'm not entirely sure but I believe EWS is part of your exchange server installation. I'm not sure about backward compatibility with outlook 2003 either, sorry. – jeroenh Nov 19 '12 at 14:17