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(By Val url As String) As String
Dim file As String = Server.MapPath( url)
Dim sr As System.IO.Strea mReader
Dim fi As New System.IO.FileI nfo(file)
Dim strContents As String = ""
If System.IO.File. Exists(file) Then
sr = System.IO.File. OpenText(file)
strContents += Server.HtmlEnco de(sr.ReadToEnd ())
sr.Close()
End If
Return strContents
End Function
"Lau Lei Cheong" <le****@yehoo.c om.hk> wrote in message
news:Oy******** *****@TK2MSFTNG P14.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.c om>
¼¶¼g©ó¶l¥ó·s»D: uX************* *@tk2msftngp13. phx.gbl...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?