I wrote a function which reads it ok. (See below)
The only probelm is that the HTML shows up in the email message with the raw
code, even though I set IsBodyHtml to true. Any ideas?
Here's the code to read the html...
Private Function ReadHtmlPage(ByVal url As String) As String
Dim file As String = Server.MapPath(url)
Dim sr As System.IO.StreamReader
Dim fi As New System.IO.FileInfo(file)
Dim strContents As String = ""
If System.IO.File.Exists(file) Then
sr = System.IO.File.OpenText(file)
strContents += Server.HtmlEncode(sr.ReadToEnd())
sr.Close()
End If
Return strContents
End Function
"Lau Lei Cheong" <le****@yehoo.com.hk> wrote in message
news:Oy*************@TK2MSFTNGP14.phx.gbl...
If the HTML file is located on your server, just read it as ordinary text
file and perform string.Replace() on the placeholders
you reserved.
"VB Programmer" <do**@emailme.com>
¼¶¼g©ó¶l¥ó·s»D:uX**************@tk2msftngp13.phx.g bl...I have an HTML file that I want to read on the fly and insert the contents
into a string (for the body of an email.) How can I do this?