vb 发送html邮件,如何通过电子邮件发送动态创建的htmltable - vb.net

我创建了一个htmlTable,我想通过电子邮件发送它:

Dim MyRow As New HtmlTableRow

Dim cellCost, cellDisplayName, cellMoreInfo As New HtmlTableCell

Dim tableAttributes As New HtmlTable

tableAttributes.ID = "test"

cellCost.InnerText = "$45.00"

cellDisplayName.InnerText = "I am display Name"

cellMoreInfo.InnerText = "I am more information"

MyRow.Cells.Add(cellCost)

MyRow.Cells.Add(cellDisplayName)

MyRow.Cells.Add(cellMoreInfo)

tableAttributes.Rows.Add(MyRow)

PlaceHolder1.Controls.Add(tableAttributes)

当试图通过电子邮件发送tableAttributes全局变量时...那就是我遇到麻烦的地方:

Message.Body = tableAttributes.anything< - 失败

如何创建动态生成的表然后通过电子邮件发送它?

**更新 - 提供了解决方案

哈哈!它奏效了,你真棒。这是我根据你的建议创造的:

Dim SB As New StringBuilder()

Dim SW As New StringWriter(SB)

Dim htmlTW As New HtmlTextWriter(SW)

Dim x As New HtmlTable

x = Session("table")

x.RenderControl(htmlTW)

Dim sTable As String = SB.ToString()

Response.Write("*" & sTable & "*")

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值