include file within script

S

shank

I have the below code to auto-email a customer.

What is the syntax to include a file in the email? <!--#include
file="agreement_inc.asp" -->

HTML = HTML & "...just some text...<br>"
HTML = HTML & <!--#include file="agreement_inc.asp" -->
HTML = HTML & "</body>"
HTML = HTML & "</html>"

thanks
 
B

Bob Milutinovic

shank said:
I have the below code to auto-email a customer.

What is the syntax to include a file in the email? <!--#include
file="agreement_inc.asp" -->

HTML = HTML & "...just some text...<br>"
HTML = HTML & <!--#include file="agreement_inc.asp" -->
HTML = HTML & "</body>"
HTML = HTML & "</html>"

thanks

sIncludeFile = "somefile.txt" ' modify as appropriate
set oFSO = Server.CreateObject("Scripting.FileSystemObject")
set fRead = oFSO.OpenTextFile(sIncludeFile)
sReadText = fRead.ReadAll
fRead.Close
set fRead = nothing
set oFSO = nothing

HTML = HTML & "...just some text...<br>"
HTML = HTML & sReadText
HTML = HTML & "</body>"
HTML = HTML & "</html>"



HTH,

- Bob.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top