简体   繁体   English

如何按线程分组电子邮件?

[英]How to group e-mails by thread?

I need to recognize if email message is an response for message sent by my application, to put it into same email thread (something like gmail does). 我需要识别电子邮件是否是我的应用程序发送的消息的响应,将其放入相同的电子邮件线程(类似于gmail)。 How can I mark an email or what data let me to recognize if it's an answer for one of previous messages in a thread? 如果它是线程中先前消息之一的答案,我如何标记电子邮件或允许我识别哪些数据?

I'm connecting through IMAP protocol, but I can easily switch to pop3 if it will be easier... 我通过IMAP协议连接,但如果更容易,我可以轻松切换到pop3 ...

When you send your e-mail, include a Message-ID header with some globally-unique ID for your message. 发送电子邮件时,请为邮件添加一个Message-ID标头,其中包含一些全球唯一ID。

When you get the response, it should have a References header that refers to your original Message-ID . 当您收到响应时,它应该有一个References标头,引用您的原始Message-ID

The 'In-Reply-To' header of the child should have the value of the Message-Id header of the parent. 子项的“In-Reply-To”标头应具有父项的Message-Id标头的值。

There is one another field in header 'References' which contains message ids of all its parent. 标题'References'中还有另一个字段,其中包含其所有父项的消息ID。

you can user either of them as per your requirement. 您可以根据您的要求使用其中任何一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM