Email question on Action.Body

Greetings all.  Looking for some help on sending email.  I'd like to update the body of the email to include the lines of a txt file, instead of attaching the text file to the email message.  I'm using an external app to generate a log file, and its annoying to have to open up the attachment to view the lines inside of it, would be cleaner if I could put the log lines into the body instead.

I thought there'd be a way in the VBscript to do something like the following, but its not adding the lines (yes, the log does contain info).

 

Dim objFSO, objTextFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("C:\Temp\dbdiffresults.log", ForReading, True)

Action.Body = objTextFile.ReadAll

objTextFile.Close

Thanks in advance,

  Rich W.

Hi Rich

The problem seems to be that the constant ForReading is not registered with the script engine (I’ll look into that). If I use this code it works fine :

Set objTextFile = objFSO.OpenTextFile(“C:\Temp\dbdiffresults.log”, 1, True)

HTH

Yup, that did the trick - thanks much!