Image in Email Body - Using Send Email Activity

Hello UiPath Community,

I have tried with below

  1. html → img src
  2. html → img content-id

Not able to achieve the solution.
I need image(which is extracted from an email and saved in the local folder) in the email body and send email.

Please assist.
Thank You.

Hi @Rajesh.Attada01

can u share the body of email in txt format ?

Hi Nived,

PFB:
“<img src=‘cid:’”+oAttachment.ContentId+“‘’>”

is there any way to achieve with img src → html?

It will be just visible on your local machine with href

Can u try regex to extract the img src

Like this

(?=[<img]).*

@NIVED_NAMBIAR and @Pravin_Patil1
Thanks both of you for assisting me.

Got the solution.

  1. Read image into Byte
    byteArray=System.IO.File.ReadAllBytes(“Image.jpg”)

  2. Convert Byte Array to base64 String
    base64String=Convert.ToBase64String(byteArray)

  3. Place the base64String inside the HTML img tag
    “<img src=”“data:image/jpg;base64, base64String”“alt=”“Red Dot”“>”

  4. Happy Face → you will see the image in the email body as output.

2 Likes

Great work!

Thank You Pravin.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.