An API that connects multiple Microsoft services, enabling data access and automation across platforms
MS Graph - InternetMessageHeader error when sending mail with nested attachments
First, I am getting the mails from the mailbox.
One mail contains an Outlook email attachment(.eml) as ItemAttachment and this mail contains 2 ItemAttchments (nested attachments).
var result = await graphServiceClient.me.MailFolders.Inbox.Messages[message.Id] .Attachments[parentmail.Attachments[0].Id].Request().Expand("microsoft.graph.itemattachment/item").GetAsync();
This retrieves the .eml mail with attachments. The Item property of result contains 40 internet message headers
Now if I send a new mail with the Item object of result as ItemAttachment in the new mail, it throws the error
Code: InvalidInternetMessageHeaderCollection
Message: Maximum number of headers in one message should be less than or equal to 5.
ClientRequestId: xxxxxx....