|
-
Mar 31st, 2005, 05:09 AM
#1
Thread Starter
Lively Member
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.
-
Mar 31st, 2005, 05:31 AM
#2
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:
Dim wrq As WebRequest
Dim wrp As WebResponse
Dim sr As StreamReader
Dim strHTML As String
Dim sw As StreamWriter
wrq = WebRequest.Create("whateverpage.aspx")
wrp = wrq.GetResponse()
sr = New StreamReader(wrp.GetResponseStream)
strHTML = sr.ReadToEnd
sw = File.CreateText(Server.MapPath("temporarypage.html"))
sw.WriteLine(strHTML)
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|