I want the rendered page to appear in the body of an e-mail. To do this it seems I have to render the page to a Writer object (something I'm new to). So here is what I have now:
I get the message:
System.Web.HttpException: A page can have only one server-side Form tag.
From the stack trace it seems to happen when I render. But the e-mail still goes thru?? (Tho blank.)
Code:
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
Dim newMail As New Mail.MailMessage()
Dim newStr As New System.IO.StringWriter()
Dim newHtml As New HtmlTextWriter(newStr)
Dim bodyStr As String
Me.Page.RenderControl(newHtml)
newHtml.Write(bodyStr)
With newMail
.From = "cs@centurycolor.com"
.To = "mark@centurycolor.com"
.Subject = Me.lblFormTitle.Text & " Order"
.Body = bodyStr
End With
SmtpMail.SmtpServer = "mail.centurycolor.com"
SmtpMail.Send(newMail)
End Sub
I get the message:
System.Web.HttpException: A page can have only one server-side Form tag.
From the stack trace it seems to happen when I render. But the e-mail still goes thru?? (Tho blank.)