How to send an embedded image as body of an outlook message?

hello friends,

I need to send a congratulation mail to multiple recipients who has got the certificates.

Now the template is embedded in an outlook message itself. It looks like this:
Test_Template

Now as you can see, the CERT_Name will be replaced by candidate name, Project_Name will be replaced by actual project name.
Now basically this will be the Body of the outlook message.
In TO field, we have to give recipient’s email, in CC we have to give email of his manager and delivery manager.
Now there is a excel file that has all these fields : Recipient Name,Email, Project Name, Manager email, Product manager email, recipient email etc.

I have to send it to some 200 people, this will happen every month once.

Any idea how to proceed?

Hi @sujoy_mukherjee,
I know that with UiPath Studio you could achieve it. But as you already have necessary data in excel why don’t you use Mailings option which is build in Word?


You can import your cert template to word and with use of this option generate certificate per each data from excel and even send it to recipients based on outlook engine. It will be much faster in your case (as you have all data in excel) than build whole Studio project.

hi @Pablito ,

Thanks for your response.

Actually this is only a part of a bot I want to create in UiPath.

The excel file I talked about, it needs to be created by executing different tools(each of the tools are macro), then collate the data, filter the data and then only I will get the file for a month.

There are lot of other steps I need to do to automate the whole process, including generating certificate, running some tools, change format etc and then this part comes.

And after this step I need to send a chain mail to all the participants with the actual certificate(which is in pdf).

So that is why I need to do this in UiPath.

Sure I understand :slight_smile:
Then you could do the process where Word application is opened with your template. Then send hotkey to find the key word and replace it with word which comes from excel table kept in DataTable variable. Then it would save the file and with use of Outlook activities it could send it to recipient. Then put all of this into the loop so it could iterate per each excel row :slight_smile:

@Pablito I understand but how to embed the image in email body?

For embedding image I was trying the following video:

However I am unable to do the last step. Because I am unable to find any “Send Outlook with Image” activity as well as “SB.OutlookMail.Activities” here.

@sujoy_mukherjee

refer this … it may help u

1 Like

hi @amaresan,

Thanks for sharing the link.

I have tried that, however mine is little different as the Name and project Name will change every time I send mail.

However that issue is solved. Now the problem I am facing is attaching the html template as Body of the mail - it is throwing compilation error.

Here is the xaml file - the error is coming when I am trying to assign the html code to Body(Body is a String variable that I will assign as the Body of the mail in Send Outlook mail activity).

Main.xaml (22.3 KB)

@sujoy_mukherjee

the Best way is
Assign all ‘html String’ in Config and use config key to get value

otherwise remove all newline. Kept all values in Single line

it will work

Thanks

hi @amaresan,

I am in Level 1 only, so I have no idea about how to use/create config.

I have removed all newline keep all the html tags in single line…but the error is there as it is.