How to email a datagrid

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

  1. how to you email a datagrid as a html 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 Tichenor, Feb 13, 2004
    #1
    1. Advertising

  2. Hi Dave,


    I'm reviewing this post and found that you provided some of your research
    results and share it with others,yes? I think the solution you provided so
    informative that it'll save a lot time for many others who're searching
    for the similiar things. Thanks very much for posting here and sharing your
    experience. In the meantime, if you have any questions or other opinions,
    please always feel free to post here.




    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. Peter
    Replies:
    0
    Views:
    3,428
    Peter
    Jul 1, 2003
  2. John Silver
    Replies:
    0
    Views:
    634
    John Silver
    Feb 4, 2005
  3. Tee

    Email ErrorPage to email

    Tee, Jun 23, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    397
  4. Replies:
    3
    Views:
    569
    AdamM
    Jul 27, 2004
  5. Chuck Amadi
    Replies:
    2
    Views:
    421
    chuck amadi
    Jun 6, 2004
Loading...

Share This Page