Skip to main content

Notifications

Community site session details

Community site session details

Session Id : IwiHxfgfUYSGz9EjZoc3kg

How to embed an image in Outlook email body in Power Automate Desktop

VJR Profile Picture Posted 19 May 2022 by VJR 7,635

 

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.

 

VJR_1-1652955216076.png

 

2. Get the filename with extension from the above path.

Disable all other output variables and enable only the one shown below.

 

VJR_2-1652955282726.png

 

 

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.

 

 

VJR_3-1652955733167.png

 

- 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

 

VJR_4-1652955870576.png

 

 

5. That's it. The entire Flow looks as below.

 

VJR_5-1652955991572.png

 

Output after running the Flow: 

There is no file attached but the image will be embedded within the body of the email.

 

VJR_6-1652956104595.png

 

 

PS:

- Flow is built in PAD v2.18

- Copy the content of the attached text file and Paste it into a blank Flow editor

 

 

 

 

Categories:

Desktop flows

Comments

  • Community Power Platform Member Profile Picture Community Power Pla...
    Posted 19 Sep 2023 at 23:22:25
    How to embed an image in Outlook email body in Power Automate Desktop

    Great solution thanks. 

  • VJR Profile Picture VJR 7,635
    Posted 27 Jun 2023 at 10:45:18
    How to embed an image in Outlook email body in Power Automate Desktop

    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&colon;image/png;base64,%VarName%" alt="SomeImage" />

     

    alt is any alternative text to give for the image.

     

    Please note the : sign automatically got converted to &colon; after submitting the post.

    The correct syntax is:

    VJR_0-1687862820401.png

     

    https://learn.microsoft.com/en-us/power-automate/desktop-flows/how-to/add-images-email-messages

  • VJR Profile Picture VJR 7,635
    Posted 05 Jan 2023 at 03:22:09
    How to embed an image in Outlook email body in Power Automate Desktop

    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.

  • Ben_Hyland Profile Picture Ben_Hyland 6
    Posted 04 Jan 2023 at 14:31:47
    How to embed an image in Outlook email body in Power Automate Desktop

    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.

     

    Ben_Hyland_0-1672842691056.png

     

  • VJR Profile Picture VJR 7,635
    Posted 23 Jul 2022 at 02:57:02
    How to embed an image in Outlook email body in Power Automate Desktop

    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 🤞

  • ryule Profile Picture ryule 927 Super User 2024 Season 1
    Posted 15 Jul 2022 at 19:45:38
    How to embed an image in Outlook email body in Power Automate Desktop

    Thanks, worked perfect! (I just used the Send Email action instead of the "Outlook" actions, but all the same variable stuff before it)