Changing Mail Body Dynamicaly Through Iteration

Hi, I am sending mail fetching names and emails from an excel sheet.
I am changing the email address with every iteration in for each row.
I also want to change the name in the mail body.
How can I do this directly in the body section of SMTP?
I am being able to change the name also if at first read it from a text file and replace the name during iteration in the txt file and then send that text file in the mail body.
But can the name also be changed during each iteration directly in the SMTP mail body section?

Is it like in Body you need to add name of the person which was taken from excel ?


1 Like

yes, different names after every iteration.

I assume the template is same in body , only the name get changes
so in this case, follow below steps
Keep the template somewhere , like in Excel
Hi {Name},

How are doing.


In Excel ,

Keep like
Hi {0},< br>
How are doing.< br>
Regards< br>

Store as Dictionary(key ,value pair)

In SMTP , check the checkbox for html and in Body field give
String.Format(Config(“EMailBody”).tostring, Name Variable from excel)

the above one use in loop


1 Like

ok, i will try and let know.

but here the content of the body is also being fetched from the excel right?
But i want only the name to be fetched, not the entire body content from excel.
I am typing the body in html format in the SMTP body section, only the name needs to be replaced after every iteration.

Yes, If body template is same for all mails except Name, then we can get the body from excel

Is the content in the body also changing with Name?


No, content remains same, only name changes.

Then you can keep the body in Excel as given above
Did that solution did not solve what you are expecting?


As I said in my post that passing a mail template into the body it is working perfectly.
But I also need to embed signature GIF.
There comes the problem with passing template into the body.

For Signature ,you can do a one time step for Signature to come in you every mail in mail setting then you don’t need to worry about the signature to come


I am using Mozilla Thunderbird, using SMTP it does not attach the gif signature, though the message gets sent.

Check this: How to add the images in SMTP mail body - #3 by sankar.kuna

This does not work for me.
Okay can you tell me one thing?
I have read a txt file as email template and stored in an output.
I am passing that output in the body of the SMTP.
But want to add something more that is not stored in the output.
How can do that in the same SMTP body?

First use
Use Append line activity to add text to the existing .txt file.

then you can add the whole to SMTP