Table format as body in mail( not fetching table data from any file)

send a mail with below format of table in “Body” of mail?How can we Achieve this


@ndivya, You need to use a HTML Table in order to achieve this and while using send mail activity just check the IsBodyHtml property.

References :

  1. How to write excel data in outlook mail? - #11 by akhi_s27
  2. HTML Tables

Dominic :slight_smile:

Hi @ndivya,

ExcelToMail.xaml (22.6 KB)
book.xlsx (8.8 KB)

1 Like

Not able to Dispaly current time in Table,
For eg:

I have taken a variable del_time and assigned value now,then using message box del_time.tostring() able to display current time but if i put same in tags not getting current time.


@ndivya , I think you are trying to use that variable name directly inside the html table document. Why not read that html table file using Read Text File Activity and replace the variable name with a placeholder like {0} something and output to a string (Say str). And Replace this {0} with your dateime variable here while sending the mail.

Dominic :slight_smile:

Not reading time from text file.I have taken a variable which stores current time and trying to read that variable in like below.

Alert Date del_time

del_time is variable which holds currenttime.tostring() value.

@ndivya, I understood you are not reading time from text file. Let me ask in simple terms, from where do you get that image ? How are you using that ? Can you share your workflow if possible ?

Dominic :slight_smile:

Image is in body of mail.In body i am using Html tags as below(Replace || with <>if i give correctly with braces while posting in site it is converting to table)


@ndivya, Its working fine for me ! Can you try this Table format as body in mail( not fetching table data from any file) - #5 by Dominic that I have said above in the same thread ?

Dominic :slight_smile:

I am not reading anything from text file.Just i want to display time in body of mail ,so i was using HTML tags for format of table

1 Like

It should be in this manner
“< tr>< td>” +del_time.tostring +“< /td>< tr>”

Remove spaces in tr and td.

“< html>< body>< table>
“< tr>< td>”+del_time.tostring+”< /td>< /tr>"
< /table>< /body>< /html>"
End of expression expected error is populated,removed spaces in tags

Try this:

“< html>< body>< table>< tr>< td>"
+“< /td>< /tr>< /table>< /body>< /html>”

String Constant must end wth double quote error

Can you check the double quotes. I don’t think there is any issue in the string. Try to debug it.

This could be due to a bug in the editor.
Try deleting all the “new line” character at the end of each line, so the entire statement is 1-line.

Please let us know if this works.
Happy automating!

1 Like

Hello @Laxman_Pratap,

This code works good, however can you tell me how i can embed this table into an Outlook body for example: (I am unable to get new lines working)

Hello All,
This is to remind you.

Thanks and Regards,
Team Name

Even I am getting the same error “String Constant must end with double quote”.

Please help me to resolve this issue.

Hi "

happy birthday



Got the solution. As you said, I have checked the double quotes as well as deleted all the new lines and made it as one line.

@HaveFaith, @palindrome

Use this (Convert Mail to Excel), format is also preserved.

Same logic can be implemented in C# ,will post soon.