如何保存收到邮件的数字签名
我正在尝试保存当前打开的邮件项目的数字签名。
现在我意识到 Outlook 阻止以编程方式加密/签署新电子邮件。在这里,我重点关注已收到的消息。
到目前为止,我只能使用 MessageClass 属性来检测签名的电子邮件。
Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = CreateObject("Outlook.Application")
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
' anything else will result in an error, which is
' why we have the error handler above
End Select
Set objApp = Nothing
End Function
Sub DoExport()
Set CurrentItem = GetCurrentItem()
If CurrentItem.MessageClass = "IPM.Note.SMIME.MultipartSigned" Then
MsgBox CurrentItem.MessageClass
End If
End Sub
I am trying to save the digital signature of the currently opened mail item.
Now I realize that Outlook prevents access to encrypt/sign a new email programmatically. Here I am focused on messages which have been received.
So far, I am just able to use the MessageClass property to detect a signed email.
Function GetCurrentItem() As Object
Dim objApp As Outlook.Application
Set objApp = CreateObject("Outlook.Application")
On Error Resume Next
Select Case TypeName(objApp.ActiveWindow)
Case "Explorer"
Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1)
Case "Inspector"
Set GetCurrentItem = objApp.ActiveInspector.CurrentItem
Case Else
' anything else will result in an error, which is
' why we have the error handler above
End Select
Set objApp = Nothing
End Function
Sub DoExport()
Set CurrentItem = GetCurrentItem()
If CurrentItem.MessageClass = "IPM.Note.SMIME.MultipartSigned" Then
MsgBox CurrentItem.MessageClass
End If
End Sub
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
即使在加密和签名的邮件上,消息类似乎始终是“IPM.Note”。
我使用此代码来读取谁签署了邮件。
设置 PropertyAccessor = mailitem.PropertyAccessor
如果 PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/id/{00020328-0000-0000-C000-000000000046}/9104001f") <> ”“那么
结束
结束如果
Messageclass always seems to be "IPM.Note" even on encrypted and signed mail.
I use this code to read who signed the mail.
Set PropertyAccessor = mailitem.PropertyAccessor
If PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/id/{00020328-0000-0000-C000-000000000046}/9104001f") <> "" Then
END
End If