tags:

views:

62

answers:

2

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

+2  A: 

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.

Timwi
+2  A: 

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.

Avadhesh