I need help on how to email a Datagrid as a HTML

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)
 
S

Steven Cheng[MSFT]

Hi Dave,


I'm reviewing the post and found that this one is a duplicated one with
another in the ASP.NET queue. I've replied you in that one. I've also
tested on your code and it worked well. If you have any detailed questions
, please feel free to post there. I'll be willing to assist you.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,023
Latest member
websitedesig25

Latest Threads

Top