格式化电子邮件

时间:2014-04-16 09:45:17

标签: vb.net winforms

我有数据集中的数据,我正在循环为电子邮件建立数据,数据如下,但我使用以下内容使用标签生成电子邮件,但它没有看到非常iffiencet我只能使用纯文本是他们的一种更好的方法,可以像使用数据表大小或其他东西一样格式化

enter image description here

    Dim dataForEmail As String = ""
    Dim msg As String = ""
    msg = "The Following Deliverys where processed for the Following Ordernumbers at " & DateTime.Now.ToString() & Chr(13)
    dataForEmail = "Order Number" & vbTab & "BarCode" & vbTab & vbTab & vbTab & "Description" & vbTab & vbTab & vbTab & vbTab & vbTab & "Brand" & vbTab & vbTab & vbTab & "Size" & vbTab & "Colour" & vbTab & "Price" & vbTab & "RRP" & vbTab & vbTab & vbTab & "Qty" & Chr(13)
    Dim totalcost As Decimal
    If Not IsNothing(results) AndAlso Not IsNothing(results.Rows) _
    AndAlso results.Rows.Count > 0 Then
        For Each thisRow As DataRow In results.Rows
            CreateDeliveryIncFileForGemini(thisRow)
            totalcost = totalcost + thisRow.Item("RRPPrice")
            dataForEmail = dataForEmail & BuildReportFoEmail(thisRow)
            connection.ExecuteNonQuerySql(scriptBuilder.SetDeliveryStatus(2, 1, thisRow.Item("r3DeliveryId")))
        Next
        connection.ExecuteNonQuerySql(scriptBuilder.SetDeliveryStatus(1, 0))

        dataForEmail = dataForEmail & vbCrLf & "Total Price " & totalcost.ToString()
        SendEmailViaWebService(dataForEmail, cfb.EmailForDeliverys, cfb.FullNameForEmailSubject, msg)
    End If
    CloseConnection()

0 个答案:

没有答案