D
Dave
I need help on how to email a Datagrid as a HTML - So far i get the email message as a text with all the HTML code in it.
Thanks
Below is my code
email message.
this is what i have
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
'Create MailMessage instance, set properties, and send
Dim Mail As New MailMessage
Dim sw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(sw)
Dim body As String
'Render DataGrid output as Html
EligInfo.RenderControl(hw)
'Dim dataGridHTML As String = hw.ToString()
Mail.To = "(e-mail address removed)"
Mail.Cc = ""
Mail.Bcc = ""
Mail.Subject = "Requested Eligibility Change"
'Mail.BodyFormat = MailFormat.Html
Mail.Body = sw.ToString
Mail.From = "(e-mail address removed)"
SmtpMail.SmtpServer = "Mailserver"
SmtpMail.Send(Mail)
Thanks
Below is my code
email message.
this is what i have
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
'Create MailMessage instance, set properties, and send
Dim Mail As New MailMessage
Dim sw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(sw)
Dim body As String
'Render DataGrid output as Html
EligInfo.RenderControl(hw)
'Dim dataGridHTML As String = hw.ToString()
Mail.To = "(e-mail address removed)"
Mail.Cc = ""
Mail.Bcc = ""
Mail.Subject = "Requested Eligibility Change"
'Mail.BodyFormat = MailFormat.Html
Mail.Body = sw.ToString
Mail.From = "(e-mail address removed)"
SmtpMail.SmtpServer = "Mailserver"
SmtpMail.Send(Mail)