I'm using Microsoft Graph to pull email data from a mailbox. When I get the content, I find embedded images with content like so:
<img id="_x0000_i1029"
width="1366"
height="672"
data-outlook-trace="F:1|T:1"
src="cid:image005.png@01D4DE3D.90A3C410"
style="width:14.2291in; height:7.0in">
When the property hasAttachments
is true, I look for images that match and replace the content and it works great. The problem is I see embedded image tags like this on messages where hasAttachments
is false.
Where can I get the image data Graph says the Message has no attachments but there clearly are embedded images?
Note that the image renders in Outlook for the Web with a tag like:
<img data-imagetype="AttachmentByCid"
originalsrc="cid:image005.png@01D4DE3D.90A3C410"
data-custom="AAMkADY1YjgxM2Y4LTE5NTUtNDBjMy1iZDY0LWIzN..."
naturalheight="672"
naturalwidth="1366"
src="https://attachments.office.net/owa/mailboc@mydomain.onmicrosoft.com/service.svc/s/GetAttachmentThumbnail?id=AAMkADY1YjgxM2Y4LTE5NTUtNDBjMy1iZDY0LWIzN...&thumbnailType=2&owa=outlook.office365.com&scriptVer=2019031102.10&X-OWA-CANARY=kKWSUkiFW0WjlPXXXXXXXXX.&token=eyJhbGciOiJSU...&animation=true"
id="_x0000_i1029"
data-outlook-trace="F:1|T:1"
style="width: 1024.49pt; height: 504pt; cursor: pointer;"
crossorigin="use-credentials" >