Html Body Content

Hi there,

I am trying to send an email with html body content but looks like I dont receive the desired result. In my html body there is #name which I want to replace with the row “Name” using a For each row so when the person gets the email he will receive it with his name.

The for each row is working for the first person, the system sends the email with the name of the first person in a correct way, but when it comes to the second person, the system sends the email with the same name of the first person but in the email of the second person. So the only issue is with the name cuz the email address is correct, they both receive it in different email addresses but with the same person Name.
Any idea please?


we can define placeholders and can populate it with variable values. Give a try at this

1 Like

@Xheni_Xhensila Are you using the replacing within the forloop? here the problem is in the first execution it will replace #name with the first values in the excel. So it’s better to use placeholder as suggested by @ppr .

Else in each loop, you have to copy the HTML content from another variable.

1 Like

You get the error because you replaced #name in the first iteration. In the second iteration there’s no #name anymore.

To fix the bug, create a new string variable, e.g.

CurrentMailBody = HtmlSave.Replace("#name", CurrentRow("Name").ToString)

And use CurrentMailBody in the Send Outlook Mail Message instead.


thank u, yes i figured out that was the issue. your solution is what I did.thank u to all of u for the answers