question

ShashwatBisoyi-422 avatar image
1 Vote"
ShashwatBisoyi-422 asked

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

microsoft-graph-sdkmicrosoft-graph-mail
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers