无论如何以通常传输的格式获取电子邮件消息? [英] Anyway to get the email message in the format that is usually transmitted?
问题描述
假设我正在编写一个包含内嵌图像和附件的电子邮件,我对如何传输内容感兴趣 - 换句话说,我对通过网络传输的实际ascii文本感兴趣 - 完成标题,哑剧类型等,
被各自的边界包围...
Suppose I am composing an email with inline images and attachments, I am interested in how that content is transmitted - in other words, I am interested in the actual ascii text that is transmitted over the wire - complete with the headers, mime-types, etc,
enveloped by the respective boundaries...
我知道outlook有一个专有的* .msg格式。因此,如果我收到了一封电子邮件,如果我点击Outlook客户端的电子邮件并执行
另存为... 操作,我可以选择保存到* .msg格式。但是在打开记事本时会发现很多二进制垃圾无法解读。
I am aware outlook has a proprietary *.msg format. Hence say if I've received an email, and, if I click on an email from the outlook client and perform a Save As... operation, I have the option to save it to *.msg format. But on opening that in notepad reveals a lot of binary junk which is impossible to decipher.
我是一堆错误交织在一起的好意图
I am a bundle of mistakes intertwined together with good intentions
推荐答案
您好,
详细描述了MSG文件格式。请参阅 [MS -OXMSG]:MSDN中的Outlook项目(.msg)文件格式。
The MSG file format is described in depth. See [MS-OXMSG]: Outlook Item (.msg) File Format in MSDN.
此外,您还可以从低级属性中获取标题和其他信息。例如,您可以使用
PropertyAccessor 获取属性值的对象:
Also you can get headers and other information from low-level properties. For example, you can use the PropertyAccessor object for getting property values:
Sub DemoPropertyAccessorGetProperty()
Dim PropName, Header As String
Dim oMail As Object
Dim oPA As Outlook.PropertyAccessor
'Get first item in the inbox
Set oMail = _
Application.Session.GetDefaultFolder(olFolderInbox).Items(1)
'PR_TRANSPORT_MESSAGE_HEADERS
PropName = "http://schemas.microsoft.com/mapi/proptag/0x007D001E"
'Obtain an instance of PropertyAccessor class
Set oPA = oMail.PropertyAccessor
'Call GetProperty
Header = oPA.GetProperty(PropName)
Debug.Print (Header)
End Sub
您可以尝试使用任何低级属性资源管理器工具,例如MFCMAPI或OutlookSpy。
You can try to use any low-level property explorer tool such as MFCMAPI or OutlookSpy.
这篇关于无论如何以通常传输的格式获取电子邮件消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!