How to add an image (Relative Path) in HTML body (Outlook Activity)?

Hi,

I would like to add an image as a banner in the email body,

Route: Data\Images\Email_banner.png
image

HTML:

Current Result:
image

Any ideas?

1 Like

Hy @Tana20

1)Just try to give a full path of the file including the root directory information at the IMG src tag

  1. use a .JPEG extension file instead of .PNG

Thanks @nv08 but I can’t use the fullpath, the package is going to run in a different environment. I need to use a Relative Path
Changing from .png to jpg didn’t work :frowning:

Hi @Tana20

Since u are saving in your local folder it won’t work when it opens in email in some other account.

So better instead of filepath of the image as per the local folder , use url of image file which is stored in gdrive or any other cloud storage services in the HTML

It will work definitely.

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed::relaxed:

@Tana20 - Please check this post…This has the solution…

1 Like

Working on it…

It didn’t work :frowning: …I can now add attachments, but that is not the goal, what I want is to add an image in the body message

Does the image would change depending upon the email or it would be constant throught the project?

The image will never change, and neither will the source, it will always be in: Data \ Images \ Email_banner.png

Hi @Tana20 ,
Please try below step,it might help you.
1)Send outlook mail msg activity .(isbodyhtml on)
2)use img scr tag in body along with image path.
3)Click on attach file and pass the same image path.(direction “in” )

I got Your point use URL image for an example i will give on url Image You Use it will work

http://stskproptech.com:81/PropertyAssessment/Image/getImage/21/Sankranthi%20&%20Pongal_01.jpg

use this in the banner if its work
take your image what you want to put and save in the google drive it will give one URL Like https://drive.google.com/open?id=xyz this NOTE its should be in public

  1. Right Click on Image after upload in google drive click get link

  1. Click Viewer give anyone with the link

Take that URL and past it in the note pad
https://drive.google.com/uc?id=xyz usse this replace xxx to Your URL like this 1FYwkr1RkMSv_kOi_jmICHgTgHN5S2Bzo Rplace with xxx and you will see u r image in HTML you want to check means you can save image.html

Finally u use that URL in your HTML code

I hope it will work

Thanks
Chethan P

hi
please test with attached xaml ExchangeEmailwithImage.xaml (9.1 KB)

you can try same with outlook acctivity

1 Like

Thanks, @copy_writes , I understood your point, but I cannot use cloud services other than ours.

I’m just looking for a way to embed images in the Body, but from a relative path using HTML

@shaikmdrafi Did you convert an image to a variable by using Assign activity? does it work? I’ll give it a try :slight_smile: :open_mouth:

Hi @Tana20

Try this activity

https://connect.uipath.com/marketplace/components/send-outlook-mail-with-embedded-images

Let me know if it is helpful for you

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed:

@NIVED_NAMBIAR apologies… I forgot to mention that I cannot use custom packages :sob:

As I understand that image is contant, so you can convert the image once into base64 format and get that base64 string ( you can do this from any free online sourse). And then while adding tag in you html body add base64 string in below instead of < base64 string>.

<img src="data:image/png;base64, <base64 string>" />
2 Likes

@shubham Thank you! it works :star_struck:

1 Like

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