Dear Imar,
I really appreciated that you were so kind in this novice matter.
I have gotten the right solution. I included my codes for user's reference.
Thanks,
HD
Public Shared Sub SendConfirmationMessage( _
ByVal theShoppingCart As ShoppingCart, ByVal orderId As Integer, _
ByVal userName As String, 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 theSender As String = "
[email protected]"
Dim theSubject As String = "Your order at Sports Camps"
Dim theMessage As String = My.Computer.FileSystem.ReadAllText _
(AppConfiguration.ConfirmationMessageLocation)
theMessage = theMessage.Replace("##ShoppingCart##", GetHtmlFromControl(myGridView))
theMessage = theMessage.Replace("##OrderNumber##", orderId.ToString())
Dim message As MailMessage = New MailMessagetheSender, emailAddress, theSubject, theMessage)
message.IsBodyHtml = True
Dim mySmtpClient As New System.Net.Mail.SmtpClient
mySmtpClient.Send(message)
End If
Catch ex As Exception
End Try
End Sub
End Class