Hi Here is the code that I used and it works perfect. Give this a try and let me know if it works for you.
Public Shared Sub SendConfirmationMessage( _
ByVal theShoppingCart As ShoppingCart, ByVal orderId As Integer, _
ByVal emailAddress As String)
Try
Dim myGridView As GridView = CreateGridView()
myGridView.DataSource = theShoppingCart.Items
myGridView.DataBind()
If myGridView.Rows.Count > 0 Then
myGridView.FooterRow.Cells(0).Text = "Totals:"
myGridView.FooterRow.Cells(3).Text = _
String.Format("{0:c}", theShoppingCart.Total)
Dim theSubject As String = "Your order at Carefree Jewelry"
Dim theMessage As String = My.Computer.FileSystem.ReadAllText _
(AppConfiguration.ConfirmationMessageLocation)
Dim mySmtpClient As New System.Net.Mail.SmtpClient
theMessage = theMessage.Replace("##ShoppingCart##", _
GetHtmlFromControl(myGridView))
theMessage = theMessage.Replace("##OrderNumber##", orderId.ToString())
Dim myMessage As MailMessage = New MailMessage("
[email protected]", emailAddress, theSubject, theMessage)
myMessage.IsBodyHtml = True
mySmtpClient.Send(myMessage)
End If