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

email
activities

#1

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

sample


#2

@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?
  2. https://www.w3schools.com/html/html_tables.asp

Regards,
Dominic :slight_smile:


#3

Hi @ndivya,

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


#4

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

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.

del_Time

#5

@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.

Regards,
Dominic :slight_smile:


#6

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.


#7

@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 ?

Regards,
Dominic :slight_smile:


#8

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)

<tr||td>del_time</td||/tr>


#9

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

Regards,
Dominic :slight_smile:


#10

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


#12

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

Remove spaces in tr and td.


#13

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


#14

Try this:

“< html>< body>< table>< tr>< td>"
+del_time.tostring
+"< /td>< /tr>< /table>< /body>< /html>"


#15

String Constant must end wth double quote error


#16

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


#17

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!


#18

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


#19

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

Please help me to resolve this issue.

"
Hi "
+name.ToString
+",

happy birthday

Thanks

"

#20

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
Thanks.