检查MailItem是否为回复 [英] Checking if a MailItem is a reply
问题描述
给出一个MailItem
,如何确定它是否是对另一封电子邮件的答复?
Given a MailItem
, how do I tell if it's a reply to another email?
爱丽丝向鲍勃发送电子邮件.鲍勃答复爱丽丝.当Bob回复时,我要密件抄送给Charlie.每当Bob将电子邮件发送给Alice时,我都会在Bob的计算机上使用Application_ItemSend
来执行此操作,但我只想在Bob 回复给Alice(不启动新链)时,将密件抄送给Charlie. .如果可能的话,我该怎么办?
Alice sends an email to Bob. Bob replies to Alice. When Bob replies, I want to BCC the reply to Charlie. I'm using Application_ItemSend
on Bob's machine to do this every time he sends an email to Alice, but I only want to BCC to Charlie when Bob is replying to Alice (not starting a new chain). How can I do that, if possible?
推荐答案
您可以检查MailItem.ConversationIndex
属性的长度-如果它是44(十六进制字符串,PR_CONVERSATION_INDEX
属性为22个字节),则它是一个新邮件,如果长于此,则为回复/转发.请参阅 https://msdn.microsoft .com/en-us/library/office/cc765583.aspx?f = 255& MSPPError = -2147217396 了解详情.
You can check the length of the MailItem.ConversationIndex
property - if it is 44 (hex string, 22 bytes for the PR_CONVERSATION_INDEX
property), it is a new message, if it is longer than that, it is a reply/forward. See https://msdn.microsoft.com/en-us/library/office/cc765583.aspx?f=255&MSPPError=-2147217396 for more details.
您还可以检查RE FW等的主题前缀,但是可以修改主题,并且值是特定于语言环境的.
You can also check the subject prefix for RE FW, etc., but the subject can be modified, plus the values are locale specific.
这篇关于检查MailItem是否为回复的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!