First, you need to parse the content of mail message. For this purpose, you need to write code not available in .NET FCL, or find some 3rd-party library. I would recommend open-source OpenPOP.NET:
http://hpop.sourceforge.net[
^].
This library is not very well written, but it thoroughly follows all those standard for mail structure, headers and MIME types. The complexity of all of this stuff is due to the big variety of different content types, dispositions and also due to multi-part content (with different content type and content disposition for every part.
To create Word documents, you can use either use Office Interop assemblies, or, better, Microsoft Open SDK. Actually, Microsoft warns against using Office Interop in server environment:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2[
^],
http://support.microsoft.com/kb/257757/en-us[
^].
On Open XML SDK, please see:
http://www.microsoft.com/en-us/download/details.aspx?id=30425[
^].
This way, you can support new XML-based Office formats (such as .DOCX, .XLSX), ECMA-376 standard:
http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats[
^],
http://en.wikipedia.org/wiki/Office_Open_XML[
^].
This way, you can work without Office installed. Also, the documents are supported by 3rd-party software. Please see my past answers:
Convert Office-Documents to PDF without interop[
^],
Need a rather unique WPF text editor control[
^],
Hi how can i display word file in windows application using c#.net[
^],
Read a word file without using Interop.word dll...Do not want to install word in IIS..[
^].
This is another option:
http://npoi.codeplex.com/[
^].
See also: