Outlook .MSG 和 .OFT 文件格式之间有区别吗? [英] Is there a difference between the Outlook .MSG and .OFT file formats?
问题描述
这个问题有点远,但我已经花了几个小时无济于事.我有一些代码可以在网络服务器上生成电子邮件文件,并允许用户下载该电子邮件并在 Outlook 中打开它.从这里,他们可以在将电子邮件发送给一群人之前对电子邮件进行各种手动更改.
This question is somewhat of a long shot, but I've spent hours on it to no avail. I have some code that generates an email file on a webserver, and allows the user to download that email and open it in Outlook. From here, they can make various manual changes to the email before they send it to a bunch of people.
现在,我生成了一个 .OFT 文件,它基本上是一个电子邮件模板.我想要做的是生成一个 .MSG 文件,这是一封实际的电子邮件.从二进制的角度来看,这些文件格式似乎是相同的.它们具有相同的流 ID、属性和内容.
Right now, I generate a .OFT file, which is basically an email template. What I want to do is generate a .MSG file, which is an actual email. From a binary point of view, it seems these file formats are identical. They have the same Stream IDs and properties and stuff.
我的方法是首先在 Outlook 中创建一封空白电子邮件,然后将其保存到名为 Base.oft 的文件中.在我的代码中,我打开文档并修改流 ID __substg1.0_1013001E
,它是 HTML 电子邮件正文的 ID.然后我保存文件并将其写出到 cilent.这非常有效.
My approach was to first create a blank email message in Outlook and then just save it to a file called Base.oft. In my code, I open the document and modify Stream ID __substg1.0_1013001E
which is the ID for the HTML email body. I then save the file and write it out to the cilent. This works perfectly.
我对 MSG 格式尝试了相同的方法.我创建了一封空白电子邮件,将其保存为 Base.msg,并修改了相同的 Stream ID.如果我查看生成的文件,新主体实际上就在那里并保存了.但是,如果我打开电子邮件,正文仍然是空白的.
I tried the same approach with the MSG format. I created a blank email message, saved it as Base.msg, and modify the same Stream ID. If I look at the resulting file, the new body is actually in there and saved. However, if I open the email, the body is still blank.
更奇怪的是,如果我在 Outlook 中输入正文并将其保存到基本文件,我可以在流 0_1013001E 下看到该正文.如果我然后用不同的正文修改该流,我可以验证新正文确实保存在文件中,但是如果我在 Outlook 中打开邮件,我会看到旧的原始正文.就好像电子邮件正文以 .MSG 格式存储在文件中的不同位置,但是我查看了每个流,但找不到任何其他看起来像是电子邮件正文的内容.
What's even weirder is if I type in a body in Outlook and save that to the base file, I can see that body under stream 0_1013001E. If I then modify that stream with a different body, I can verify the new body is indeed saved in the file, but if I open the message in Outlook, I see the old, original body. It's as if the email body is stored in a different place in the file for the .MSG format, however I've looked through each stream and cannot find anything else that looks like it could be an email body.
也许 .MSG 文件被加密了,或者它们的主体以某种专有的二进制格式存储,与 .OFT 文件不同?希望有人对此有所了解,因为我在互联网上搜索并基本上没有发现这些格式.
Perhaps .MSG files are encrypted, or their bodies are stored in some proprietary binary format unlike .OFT files? Hopefully someone has some insight on this, as I scoured the Internet and found basically nothing on these formats.
更新:
似乎 .MSG 格式将主体存储在流 ID __substg1.0_10090102
- 以某种二进制形式编码(不确定是什么.)如果我删除流(或将其设置为单个