How to send nested attachments?
Asked Answered
S

0

5

Stuck here writing JS code to send out an email via REST within a custom Outlook add-in.

Scenario is following

report
 \
  \---- another message (item attachment)
         \
          \------- attachment (file attachment)

In words, I am sending a new report message which includes another message as an Item Attachment (that works fine).

But now, the problem is that, when sending with another message that has attachments, then this fails. Opening the report which has the other message attached doesn't show the attachments.

Query is POST https://outlook.office365.com/api/v2.0/me/sendmail

Returns 202 Accepted

Body is quite long and on this Gist https://gist.github.com/binarykitchen/2b95331c5c85e7cb4ca6f6917dc67a67

You can see Message has Attachments which has an Item Attachment (attaching another message) which has one file attachment called "bat_kitten.jpeg"

How come this sent message doesn't have this file attachment but server still responds with accepted 202?

Maybe some parameters are wrong? Not sure what to set for ContentId and ContentLocation for that file attachment?

Or are nested attachments not supported yet?

Any clues would be very much appreciated.

Satanism answered 29/6, 2018 at 3:42 Comment(3)
This is a problem with Rest API v1.0 and v2.0 too.Dowry
I mean, they probably disabled them for anti-virus reasons. Nested nested files is a bad idea for so many reasons, let alone the complexity of dealing with them in the first place.Clove
What happens if you drop the ContentId and the ContentLocation completely on that FileAttachment? It seems like those are irrelevant, and may be causing the service to behave in a way that is unexpected.Piazza

© 2022 - 2024 — McMap. All rights reserved.