接收/处理来自 .NET 的电子邮件
我正在开发一个从 POP3 邮箱检索电子邮件并将其保存到数据库的项目。 我想找到一种方法可以将原始消息链接到回复,以便我可以将它们关联地显示为一条链。 我打算使用那些不太可靠的主题行,因为它们有能力改变。 在幕后有什么东西可以用来将回复消息链接到原始消息吗?
I am working on a project to retrieve emails from a POP3 mailbox and save those to a database. I would like to find a way I can link original messages to replies so I can relationally show them as a chain. I was going to use subject lines those aren't going to be very reliable as they have the ability to change. Is there anything below the hood that I can use to link a reply message to an original message?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许有办法。 许多 SMTP 服务器在邮件中包含两个标头:
您可以沿着 In-Reply-To 标识符链返回到原始邮件,以找到整个电子邮件线程。
There may be a way. Many SMTP servers include two headers in the messages:
You could follow the chain of In-Reply-To identifiers back to the original message to find the entire email thread.
恐怕主题行是唯一通用的方式。 看看 GMail,他们就是这样做的,如果主题相同,它可能会被愚弄以线程化不相关的项目。
我认为从 Exchange 发送的电子邮件具有某种线程 ID,但这只适用于运行 Exchange 的组织内部,并且我怀疑如果邮件来自组织外部,则它是不可靠的。
您可以尝试使用主题进行串联,并应用一些启发式方法来分离不相关的项目(例如,收件人完全不同的电子邮件将是不相关的)。 但这并不是万无一失的。
Subject lines are the only universal way I'm afraid. Have a look at GMail, that's how they do it and it can be fooled into threading unrelated items if the subjects are the same.
I think email sent from Exchange has some sort of ID for a thread, but that only works inside an organisation running exchange, and I suspect it is not reliable if mails come from outside the organisation.
You could try and thread using the subject and apply some heuristics to separate unrelated items (e.g. emails with completely different recipients would be unrelated). It's not foolproof though.