How to get Outlook attachment filename from CID attribute in HTML

Mike Vaughan Edwards 1 Reputation point
2022-08-07T12:03:05.517+00:00

I have an Oultook addin that that works with emails and saves the attachments locally.
In one email's HTML the filename was given in the ALT attribute.
<img border="0" alt="3.jpg" src="cid:******@uk-mta-56.uk.mimecast.lan">

However, when the same email was forwarded through Office 365 the HTML was completely re-written:
<img border=0 width=831 height=133 style='width:8.6562in;height:1.3854in' id="Picture_x0020_2" src="cid:******@uk-mta-56.uk.mimecast.lan">
The ALT attribute has disappeared and an ID attribute has been added. It seems that the ID does not have a reliable relationship to the index of the attachments collection so I am only left with the CID attribute.

So my question is can I get the image file from the cid - "******@uk-mta-56.uk.mimecast.lan"?

Microsoft 365 and Office | Development | Other
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.