- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsHi,
I need to send a confirmation email when a user of my vb app completes a process. The HTML for this email is relatively complicated. I was hoping to use a template of some sort - one that would be compiled with the app and wouldn't require me to include the HTML file separately. I also need to insert a dynamic, large amount of text in one part of the html page each time.
I began by creating an htm file in my project, however, I can't seem to find help on how to refer to this htm file or use it in the code (i.e. in the "MailMessage.Body = " part of the code).
Am I going about this the wrong way? What is the best way to include a compiled HTML template and use it in code (especially given that I need to insert a dynamic, large amount of text in one part of the html page)?
Thanks,
Malcolm
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: culshajaPosted on 2006-01-23 at 02:09:51ID: 15764677
You could use an XSLT and pass in the data in the form of XML. You can them apply the XSLT to the XML to get the mail body in HTML. You can then have the XSLT file as an embedded resouce within your project which you can then get access to at runtime very easily. This allows you to have a greater amount of control over the presentation. I use this method myself.
anifestRes ourceStrea m("DataAid e.GPL.txt" )
Here is an example of how I get a file and read it into a string variable:
Dim s As System.IO.Stream
s = Me.GetType().Assembly.GetM
If Not s Is Nothing Then
Dim gpl As String = ""
Dim sr As New System.IO.StreamReader(s)
Dim l As String
l = sr.ReadLine
While Not l Is Nothing
gpl &= l
gpl &= ControlChars.CrLf
l = sr.ReadLine
End While
txtGPL.Text = gpl
End If