Some threading stuff.

This commit is contained in:
Burak Kaan Köse
2025-11-01 21:46:23 +01:00
parent ae9e35e091
commit 5f9b51e4db
4 changed files with 49 additions and 9 deletions
@@ -69,7 +69,7 @@ public static class OutlookIntegratorExtensions
return mailCopy;
}
public static Message AsOutlookMessage(this MimeMessage mime, bool includeInternetHeaders)
public static Message AsOutlookMessage(this MimeMessage mime, bool includeInternetHeaders, string conversationId = null)
{
var fromAddress = GetRecipients(mime.From).ElementAt(0);
var toAddresses = GetRecipients(mime.To).ToList();
@@ -93,6 +93,12 @@ public static class OutlookIntegratorExtensions
Attachments = []
};
// Set ConversationId if provided to maintain threading
if (!string.IsNullOrEmpty(conversationId))
{
message.ConversationId = conversationId;
}
// Headers are only included when creating the draft.
// When sending, they are not included. Graph will throw an error.