Sorry, I didn't look at that too well, did I? You can still only
create the file once. You can use a FileStream object to read the
contents of a file into a string variable. Problem is, you may have
trouble reading it. This overwrites body.txt. You have to close and
reopen it. Try this out, let me know.
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8 'another opening mode. Doesn't overwrite.
strInput = "options.txt"
set input = WScript.StdIn
set output = WScript.StdOut
set wshobj = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set source = fso.OpenTextFile(strInput, ForReading)
While source.AtEndOfStream <> True
Set srcBody = fso.CreateTextFile("body.txt",ForWriting)
strOptions = source.Readline
strOptionsArray = split(strOptions,",")
emailUsers strOptionsArray(0),strOptionsArray(1)
Wend
source.close
srcBody.close
Function emailUsers(strShareName,strEmailUsers)
srcBody.writeline "[Body Message]"
dim fs, body
srcBody.close
set srcBody = Nothing
set fs = fso.opentextfile("body.txt", forreading)
body = fs.readall
strCmd = "blat " & body & " -to " & strEmailUsers & " -s ""** " &
strShareName & " Share Verification **"" -f user -server
smtp.atmel.com -log log.txt -timestamp"
WScript.Echo strCmd
objRun = wshobj.Run(strCmd)
End Function