FileSystemObject content by email

liunx

Guest
Hi everybody, I need to read the content of a .asp file and store it in a variable with FileSystemObject to send the value by email . Ex:

code------------------------------------------------------

Set mail = Server.CreateObject("CDONTS.NewMail")
mail.From = "[email protected]"
mail.To = "[email protected]"
mail.Subject = "hello"
mail.Bodyformat = 0
mail.MailFormat = 0
'here is the code to read the content of .asp file for mail.body
fsoForReading = 1
set obj_fso = createobject("Scripting.FileSystemObject")
set obj_ts = obj_fso.OpenTextFile("text.asp",fsoforreading)
readFile = response.write(obj_ts.readAll)
mail.Body = readFile
mail.Send()
..................................................................................
 
Back
Top