我只是有这个HTML电子邮件想通了,现在我需要的款式,以便我能得到我在这里表这2列之间的空间是我的代码:在C#中的XElement添加样式的HTML电子邮件
var html = new XDocument(
new XElement("html",
new XElement("body",
new XElement("h2", "Your entire inventory:"),
new XElement("table",
new XElement("tr",
new XElement("th", "Product"),
new XElement("th", "Quantity")),
new XElement("tr",
from item in prodList
select new XElement("td", item.ProductName, new XElement("td", item.Quantity), new XElement("tr")))
))));
这是输出我得到:
Your entire inventory:
Product Quantity
Nissin rich & savory chicken bw - 6 pack 5
The Zombie Survival Guide 3
Maruchan Ramen Noodle Soup 5
Generic Tomatoes, Whole 2
所以我需要弄清楚如何将风格中的标签来获取填充/边框等在电子邮件
我当然希望你得到的输出是XML,而不是您发布的文本。如果没有,为什么要使用'XDocument'? – Oded 2012-02-09 20:19:09
我的最后一个问题是我从mysql获取数据到一个html电子邮件,导致我在那里。这是我最后的问题。 http://stackoverflow.com/questions/9167208/send-html-email-with-mysql-data-into-a-table-from-within-application/9169987#9169987 – 2012-02-09 20:21:49