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 文件
基础教程推荐
- 从 C# 控制相机设备 2022-01-01
- 获取C#保存对话框的文件路径 2022-01-01
- 在 VB6 或经典 ASP 中使用 .NET 2022-01-01
- 如果条件可以为空 2022-01-01
- C# 9 新特性——record的相关总结 2023-04-03
- 将数据集转换为列表 2022-01-01
- SonarQube C# 分析失败“不是指针的有效行偏移" 2022-01-01
- 更新 Visual Studio 中的 DataSet 结构以匹配新的 SQL 数据库结构 2022-01-01
- Mono https webrequest 失败并显示“身份验证或解密失败" 2022-01-01
- 重新排序 WPF TabControl 中的选项卡 2022-01-01
