Mail Body

Hi…

I need help, i want to automate send mail with colour code.

Hi…Emp
Greetings.

Mail_Body 1
Mail_Body 2
Mail_Body 3

Regards,
Team.

Above Msg is I want to send, Here only mail body changes dynamically with ‘n’ no.of lines.
how can I apply the colour code mail body lines?

Here, Greetings and Regards are constant. I want to Apply only for mail body lines.

Use html for Email body.

hi @vamsiyeluri

Use outlook and design the email body the way you wanted. as give save as from outlook and save it as a html.

after saving read the html file as text and pass it to send mail activity. Make sure that is body html property is checked.

Now if you want to change anything in the mail you want to send for example name. while designing in Outlook Give as

Hi Name

and after reading html as string use .replace method .replace(“Name”,“Actual name of the person”)

Regards
Roshan

Please mark as a solution if found helpful :slight_smile:

@ImPratham45 yes, i know we have to use as HTML but I May get in Line in 1 Mail or in another mail i’ll get 5 mail body lines. Here i want to apply only for n no.of mail body lines. how can i do it.

Hi… @unknownay

Yes, what you said is correct where source will from Excel File, where i need to split the lines. how can i apply the colour code between Hi…and Regards.

1 Like

Make an html body template in a text file till mail body lines start up to that apply your color codes and according to the body lines append them in text file once all line once those lines appended close the body and use html and then read text file and use that variable in Body of mail activity

This is the sample format. I want to get this type. i need to apply only for mail paragraph.

image

You want to read that body from Excel first then use it in html code for that u need to separate out that body message from excel as you want to apply different colour

@ImPratham45 thanks, how can I separate the mail body…the mail bodys are dynamically changes…

As you are reading excel file
Then When iterating in for each row
Use split using lines
Use Split(Row(“Message”).ToString,vbcrlf)
It will give u w an aaray of each lines
So accordingly add this lines in ur html