Embed images in emails from Power Automate Desktop
I had a case recently, that the mail sent from Power Automate Desktop must’ve had images displayed within the body. However, no such option is available from user interface. Still, it is possible!
Content-ID to the rescue!
The trick is to use CID within the body. How to do it? In the below simple steps:
- Be sure you switched on option, that “Body is HTML”,
- Add attachments you want to sent together with these you want to display within the body,
- Inside body HTML code, use
<img src="cid:[name of the attachment with extension]" />
together with all other HTML properties you need.
And that’s it! Once you send the mail and open it in Outlook, attachments which are referenced by cid
inside the body, won’t be visible under the attachments section of the e-mail (they are hidden).
In the GIF below you can see that once triggered RPA is does a screenshot of a region within my blog, then sends it via Outlook. Next, Outlook message is opened to show that the screenshot is indeed embed and not visible as attachment.
Now it’s your turn! 🙂
zi xi
Hi Tomasz,I send email though SMTP SERVER,but when I received the mail,the picture can not be shown,can you give me some advice
Tomasz Poszytek
Be sure you not only refer to an image using CID, but that you actually attach the file to an email.
UMASANKAR JEYARAJ
Great work Tomasz, working like a charm.
Tomasz Poszytek
Thanks! 🙂
Giles
Hi Tomasz
Your solution works well for emails received by people with Outlook but for OWA and Gmail the images don’t show sadly.
The HTML is correctly formatted; each img src=”filename” replaced with img src=”cid:filename” and the attachments correctly attached but it just won’t play ball in any other email clients than Outlook 🙁
Tomasz Poszytek
I suppose these clients have their constraints that require some more work..