How to send Outlook tasks requests by mail without Outlook?

佐手、 提交于 2019-12-21 05:04:08

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/13455104/how-to-send-outlook-tasks-requests-by-mail-without-outlook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!