Results 1 to 2 of 2

Thread: Mail Page Output

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2004
    Location
    india
    Posts
    95

    Mail Page Output

    hi,

    im creating .aspx page whith some server controls and some static text,table,images ... I whish to send a mail with the rendered page content including images,server control output,statc text etc.

    How can i implement this task? wat are steps i should follow
    Last edited by mahivr; Mar 31st, 2005 at 05:16 AM.

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Mail Page Output

    There may be a better way, but the first method that came to my head is to use WebRequest.

    VB Code:
    1. Dim wrq As WebRequest
    2.         Dim wrp As WebResponse
    3.         Dim sr As StreamReader
    4.         Dim strHTML As String
    5.         Dim sw As StreamWriter
    6.  
    7.  
    8.         wrq = WebRequest.Create("whateverpage.aspx")
    9.         wrp = wrq.GetResponse()
    10.         sr = New StreamReader(wrp.GetResponseStream)
    11.         strHTML = sr.ReadToEnd
    12.         sw = File.CreateText(Server.MapPath("temporarypage.html"))
    13.         sw.WriteLine(strHTML)
    14.         sw.Close()

    Now, add temporarypage.html as an attachment when sending your System.Web.Mail.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width