检查 MailItem 是否是回复 [英] Checking if a MailItem is a reply

查看:17
本文介绍了检查 MailItem 是否是回复的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定一个 MailItem,我如何判断它是否是对另一封电子邮件的回复?

Given a MailItem, how do I tell if it's a reply to another email?

Alice 向 Bob 发送了一封电子邮件.鲍勃回复爱丽丝.当 Bob 回复时,我想将回复 BCC 发送给 Charlie.我在 Bob 的机器上使用 Application_ItemSend 每次他向 Alice 发送电子邮件时都这样做,但我只想在 Bob 回复给 Alice 时 BCC 给 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 属性),它是一个新消息,如果它长于这个,它是一个回复/转发.请参阅 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆