Read Outlook .msg File(阅读 Outlook .msg 文件)
问题描述
我相信读取 Outlook .msg 文件(以获取额外的元数据,如主题、附件等)的唯一方法是使用 Outlook API - Application.Session.OpenSharedItem()
方法.
I believe that the only way to read an Outlook .msg file (in order to extra metadata like subject, attachments etc), is to use the Outlook API - the Application.Session.OpenSharedItem()
method.
如果是这种情况,那么我正在寻找在我们的应用程序服务器上运行此代码的方法,该服务器没有安装 MS Office 或 MS Outlook.我收到了错误
If this is the case, then I am looking for way to run this code on our application server, which doesn't have MS OFfice or MS Outlook installed. I'm getting the error
System.ArgumentException: progId not found. Outlook.Application
这当然是因为没有 Outlook 应用程序.
Which of course is due to the absence of the Outlook application.
有什么方法可以只安装一个 DLL 或其他东西以使 OpenSharedItem 方法工作吗?如果可能,我不想安装完整的客户端.
Is there any way to install just a DLL or something in order to get the OpenSharedItem method to work? I don't want to have to install the full client if possible.
或者,有没有一种方法可以解析 .msg 文件而不需要诸如 Outlook 之类的重要依赖项?
Or, is there a way to parse a .msg file without requiring significant dependencies such as Outlook?
推荐答案
我很久以前保存的一篇 codeplex 文章回答了这个问题
This was answered in a codeplex article I have saved from a long time ago
文章在这里,有一个名为 OutlookStorage.cs 的文件不需要 Outlook 模型.
Article is here, there is a file called OutlookStorage.cs that does not require the outlook model.
正如在下面的评论中,现在有一个 nuget 包涵盖了这一点:
As in the comments below there is now a nuget package that covers this:
这里
在评论中为 Simon Green 提供支持.
Props to Simon Green in the comments for this.
这篇关于阅读 Outlook .msg 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:阅读 Outlook .msg 文件
基础教程推荐
- 为什么Flurl.Http DownloadFileAsync/Http客户端GetAsync需要 2022-09-30
- 有没有办法忽略 2GB 文件上传的 maxRequestLength 限制? 2022-01-01
- 如何激活MC67中的红灯 2022-01-01
- 将 Office 安装到 Windows 容器 (servercore:ltsc2019) 失败,错误代码为 17002 2022-01-01
- SSE 浮点算术是否可重现? 2022-01-01
- 将 XML 转换为通用列表 2022-01-01
- rabbitmq 的 REST API 2022-01-01
- MS Visual Studio .NET 的替代品 2022-01-01
- 如何在 IDE 中获取 Xamarin Studio C# 输出? 2022-01-01
- c# Math.Sqrt 实现 2022-01-01