Łukasz W.
Łukasz W.

Reputation: 9755

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). 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...

Upvotes: 1

Views: 306

Answers (2)

Avadhesh
Avadhesh

Reputation: 4703

The 'In-Reply-To' header of the child should have the value of the Message-Id header of the parent.

There is one another field in header 'References' which contains message ids of all its parent.

you can user either of them as per your requirement.

Upvotes: 3

Timwi
Timwi

Reputation: 66584

When you send your e-mail, include a Message-ID header with some globally-unique ID for your message.

When you get the response, it should have a References header that refers to your original Message-ID.

Upvotes: 3

Related Questions