07-15-2022 12:45 PM
1. Set the full file path of the Attachment to a variable.
This step is just an example. You may already have the path in a variable or a datatable.
2. Get the filename with extension from the above path.
Disable all other output variables and enable only the one shown below.
3. 'Launch Outlook' action
4. Add the below parameters to 'Send email message through Outlook'.
The <img> tag is an html tag and the source attribute requires the ContentId of the image.
Therefore, use <img src='cid:%FileName%'> where FileName variable is derived from Step 2.
Make sure to enable 'Body is HTML' as shown below.
You still need to add the full image path as an attachment in the Attachment(s) parameter below.
- For the Account Name, use the below section shown in Outlook.
OR right click on it and Select Data File Properties.
OR Go to File menu -> Account settings -> Account settings
5. That's it. The entire Flow looks as below.
Output after running the Flow:
There is no file attached but the image will be embedded within the body of the email.
PS:
- Flow is built in PAD v2.18
- Copy the content of the attached text file and Paste it into a blank Flow editor
Great to know it uses the same idea and structure for SMTP emails too. 😊
Probably it would be the same for "Send Exchange email message" also. Haven't used it there yet 🤞.
Hi,
I've followed this identically and even tried by pasting the attached file but still can't get it to display. Have there been any updates to PAD that would affect this since? Thanks.
Hi @Ben_Hyland
Could you please open a new thread under Power Automate Desktop so that I can assist you with the issue.
Please share screenshots of the actions and its properties inside.
Thanks.
Also works as below:
In this case no need to attach the file to the email.
- Convert the image file to base64 using the existing available action called "Convert file to Base64".
- Then pass that base64 variable to the img tag as below
<img src="data:image/png;base64,%VarName%" alt="SomeImage" />
alt is any alternative text to give for the image.
Please note the : sign automatically got converted to : after submitting the post.
The correct syntax is:
https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/add-images-email-messages
Great solution thanks.