Hey everyone!
Can someone help me out?
I’m trying to insert a local image into an HTML email that I’m sending using the Mail Message activity in UiPath.
Any tips on how I can do this?
Hey everyone!
Can someone help me out?
I’m trying to insert a local image into an HTML email that I’m sending using the Mail Message activity in UiPath.
Any tips on how I can do this?
To embed a local image into an HTML email using UiPath, you first convert the image to a Base64 string. Read the image file as a byte array using File.ReadAllBytes()
, then convert it to a Base64 string using Convert.ToBase64String()
. Once you have the Base64 string, embed it in the HTML body using the <img>
tag, formatted as src="data:image/jpeg;base64,{base64Image}"
, where {base64Image}
is the Base64 string. In UiPath’s Send Mail Message activity, set the IsBodyHtml property to True
and use the HTML body with the embedded Base64 image. This allows you to directly embed the image in the email without needing to attach it separately.
Hi @Muskan ,
Use Create Html content activity and insert your image in html HTML format.
Here’s your image:
Ensure that the IsBodyHtml property is checked in the Send Outlook Mail Message activity to properly render the HTML content