Send Outlook mail with Formatting

email
outlook

#1

Hi, I’m trying to forward a mail from Outlook which contains Table. When I try to send the mail, the body loses all the formatting and the mail is received as plain text. Can someone suggest a way to send the mail as it is?


#2

Hi, I think you will want to use html with the IsHtml parameter selected. However, I’m not sure how easy it would be to convert your table to html. You might need to manipulate the string to add in table tags before each row.


#3

Thank you for your suggestion. Is that the only way, cause the table is too big. Converting it to HTML tags will be more time consuming


#4

I’m not quite sure if it’s the only and best way.

Adding the tags in can be done using Select with lambda or LINQ.
For example,
Output Data Table to string

String.Join(System.Environment.Newline,tabletext.Select(Function(row) “< td>”+row+"< /td>).ToArray())

So String.Join will combine the rows back together after using .Select to concatenate the td tag (or whatever tags that need to be added to make your html work).

Breaking up the columns would need additional concatenation probably.


#5

Thanks! I’ll give it a try