include file within script

Discussion in 'ASP General' started by shank, Apr 16, 2008.

  1. shank

    shank Guest

    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
     
    shank, Apr 16, 2008
    #1
    1. Advertising

  2. "shank" <> wrote in message
    news:...
    >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.
     
    Bob Milutinovic, Apr 17, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Victor Bazarov

    #include "file" -vs- #include <file>

    Victor Bazarov, Mar 5, 2005, in forum: C++
    Replies:
    4
    Views:
    553
    Exits Funnel
    Mar 6, 2005
  2. mark4asp
    Replies:
    2
    Views:
    2,250
    Harry Haller
    Nov 7, 2006
  3. PTM
    Replies:
    1
    Views:
    343
    Andy Dingley
    Nov 12, 2007
  4. naveeddil
    Replies:
    0
    Views:
    604
    naveeddil
    Jan 4, 2008
  5. Andreas Bogenberger
    Replies:
    3
    Views:
    973
    Andreas Bogenberger
    Feb 22, 2008
Loading...

Share This Page