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

Discussion in 'ASP .Net Datagrid Control' started by Dave, Feb 13, 2004.

  1. Dave

    Dave Guest

    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 = ""

    Mail.Cc = ""

    Mail.Bcc = ""

    Mail.Subject = "Requested Eligibility Change"

    'Mail.BodyFormat = MailFormat.Html

    Mail.Body = sw.ToString

    Mail.From = ""

    SmtpMail.SmtpServer = "Mailserver"

    SmtpMail.Send(Mail)
     
    Dave, Feb 13, 2004
    #1
    1. Advertising

  2. 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
     
    Steven Cheng[MSFT], Feb 13, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TN Bella
    Replies:
    1
    Views:
    2,479
    Edward
    Jun 18, 2004
  2. Tom
    Replies:
    7
    Views:
    442
    William Desrochers
    Sep 9, 2004
  3. Chuck Amadi
    Replies:
    1
    Views:
    311
    fishboy
    Jun 6, 2004
  4. NetNoise
    Replies:
    6
    Views:
    370
    NetNoise
    Jan 10, 2005
  5. pbd22
    Replies:
    1
    Views:
    161
Loading...

Share This Page