Embed image in email using Send Outlook Mail Message activity

Hi, I’m trying to embed an image (.png) into my email content (html codes). These are some methods that I have tried and the respective outcomes:

1. Use img src html tag with the local path of the image.
The image is not visible when sent to other computers as they do not have access to the image that is pointing to my local path.
tmp

2. Use attachment content id.
I referred to this thread and tried out something similar as proposed by @Suchi3190 but the image is not visible.
https://forum.uipath.com/t/how-to-add-the-images-in-smtp-mail-body/3054/4
tmp

3. Convert image in base64 and use data uri to show the image in my email.
It appears that for Outlook versions of 2007 and above, base64 image cannot be displayed.
https://www.campaignmonitor.com/blog/email-marketing/2013/02/embedded-images-in-html-email/
tmp

Attached is my source code.
Test Email Embed Image.zip (16.6 KB)

Appreciate your help!

4 Likes

#2 works for me. What is your outlook version? Perhaps security issue?

image

1 Like

I’m using Outlook 2016, send to another computer with Outlook 2013. May I know what is your Outlook version?

Thanks to @vvaidya I managed to narrow down the possibilities and identified the issue. Tried #2 again and sent email to a pc with Outlook 2016 and it worked.

I suspect Outlook 2013 has a slightly different way of handling embedded images, the image does not show in the mail but was sent as an attachment instead.

1 Like

I’m using outlook 2013, and not able to embed an image in mail body.
Please give the solution if anybody have.

Yes, the only problem is in outlook 2013. I checked.

Could anybody able to find out this problem/setting in outlook 2013 or not. Please let me know if your outlook 2013 is able to show image in body.

Hi,
I’m getting the following error. Can anyone help me to achieve this.And I want to know why am I getting this…?template error

Hi All,
I could able to send image in mail body through Outlook 2016.But in 2013, It’s not working.![error|690x141]error

Can anyone fixed this issue.

Can you give us more details on what are you trying to do? Maybe attach the workflow, with only the mail activities part that are failing.

For which outlook version exactly method 2 will work. I am facing the same issue.

Hello Vvaidya, Which outlook version you are using exactly. I am using Outlook 2013 but i am also facing same issue just like above mentioned

tried #2 but I am getting the error like other people using. my outlook version is 2016.

used the #2 file just changed the smtp to outlook message but its not sending image as body.

Thanks in advance

Thanks,
Dill

What exactly is the problem Dill?

Hi, I am trying to add an image into email body using HTML via giving source of the file{file path store in my laptop}. But when i am sending this email to someone the image dosen’t appear into email body and a Empty box with red cross mark saying" Either the file has been moved or deleted or renamed" . I am using the HTML code: Img SRC=‘C:\Users\Dill\Pictures\Huawei-logo-1024x768.png’ alt=‘Logo’ height=‘42’ width=‘42’

send me the project please - wf+image too (without the user and password of course)

Hi

PFA,

Send email.xaml (9.6 KB)
Photo

1 Like

Hi,

Please follow the steps given below-

  • Design the template in html including the image source and save it as .txt.
  • Read the same in UiPath Studio and save the output in string.
  • Give this string in send mail body with formatting the string as per requirement, and this will do the work.

I have attached the sample workflow.

Thanks
Vikash
email.zip (7.0 KB)

8 Likes

HI Man, It worked. Thanks a lot.

didn’t work

I have tried too its not working. Due to Image you are putting into email body its saved locally into your Pc so when you send it to someone else it will never shows up.
Unless you are using a image from online server like Google or yahoo etc. You just need to paste the url of that image into html body and send to it to someone and only then it will shows up.