Matthew
Matthew

Reputation: 10444

How can I generate email threads for outlook programmatically?

I have a web service that generatesMailMessages.

How can I generate and send multiples so that outlook recognizes them as threaded?

I have seen examples of decoding this information but nothing very clear to understand on encoding it.

When my webservice uses SMTP to send multiple emails about the same topic, I'd like the recipients of those emails, in outlook, to have the multiple emails threaded together similar to how replies will automatically chain and collapse in certain versions.

Can I do this without access to an exchange API? It seems like I should be able to since plenty of email clients thread replies without such a system.

Upvotes: 6

Views: 1880

Answers (2)

Dmitry Streblechenko
Dmitry Streblechenko

Reputation: 66276

Make sure Thread-Index MIME header is correctly set. It should be based on the PR_CONVERSATION_INDEX MAPI property (see https://msdn.microsoft.com/en-us/library/office/cc765583.aspx). Take a look at existing messages with OutlookSpy (I am its author) - click IMessage button. You can also see how Outlook creates messages and populates the Thread-Index MIME header by clicking IConverterSession | MAPIToMIMEStm button.

Upvotes: 0

Jay Kim
Jay Kim

Reputation: 73

Outlook will recognize as threads if you create a message as a reply of the original message.

The most efficient way to send a mail through Exchange Server (Outlook) is to use "Outlook Mail REST API." Normally exchange server setup the service on the installed web server.

Managing the outlook mailbox is pretty straightforward. Please refer to the following URL to learn how to use the REST API.

https://msdn.microsoft.com/office/office365/APi/mail-rest-operations#SendMessages

Upvotes: 1

Related Questions