Is it possible to send a table (coded in html) as the body of an email so that the recipient is able to view the table (parsed and displayed).
For example, I want to be able to send this as the body of an email:
<html>
<table>
<tr>
<td> col1 </td>
<td> col2 </td>
</tr>
</table>
</html>
So that the recipient sees col1 col2
.
I've read in some places that it's not possible and that I must use the table creator provided by the email service, but I'd just like to confirm to see if it's possible or not.
You can not directly use HTML or Body tag when you embedding HTML in c# string as it already going to display inside HTML Page. Below is simple table format.
You can also do styling like below
Example
You can create the table in HTML, open it up in a browser and copy & paste it into Outlook (based on the extra information you've provided in comments)
Outlook will make sense of your HTML, and provide in the same format as you pasted it.
If the client is using a text only e-mail (less likely nowadays - with most smartphones parsing HTML emails) then it will just appear a similar way to:
Without any styling.
Some years ago I found that you can insert a table in the email body when using Thunderbird. Since then I have switched to mutt. So, out of curiosity, I created a table in html by using latex2html on a simple latex table. I then opened the mutt editor to create an email and copied and pasted the html code into the mutt editor and closed it to go to the mutt compose menu. Before sending the email, I used
Ctrl-t
to edit the content type and change it from "text/plain" to "text/html". Upon sending the email and opening it in gmail in a browser, the table appeared exactly as I would have wanted.So, in summary, one can paste an html table into the mutt editor (vim, in my case) and just change the content type before sending it.
This will depend on the recipient's email client. Some display in HTML, others only display plain text.
You can send an email with a
table
inside it containing data. Just make sure you style it as a 'table containing data'. Use this as an example.This is if you are building an email.