+2 votes

We use Mail.dll to interface with Office 365. We want to build a helpdesk service that pulls emails into a helpdesk ticket. To date we have just pulled in the Subject and Body as plain text.

I would now like to pull the entire email into the helpdesk which is easy to do.

However is there a way to ID the original email?

I would need to know this if I want to automatically detect following email response belong as a thread to that original email / and therefore belong to the same helpdesk ticket.

by

1 Answer

0 votes
 
Best answer

You can use IMail.MessageId and IMail.References and IMail.InReplyTo fields for that:

  • IMail.MessageId - Message-ID header is an ID of the current message.
  • IMail.References - References header contains IDs of all referenced emails.
  • IMail.InReplyTo - In-Reply-To header contains ID of the message to which this message is reply.

However, bear in mind that not all email programs set those correctly.

Consider additionally adding something like "[TicketId: 1234]" in the subject of the email when you create a reply.

Most email programs don't modify subject when replying (apart from adding additional "RE: " at the begging).

I think the best way is to use both approaches simultaneously to thread emails reliably.

by (297k points)
...