The script below is designed to send an email when file appears in a folder; the subject is set to the filename and the body includes the file path. If I run the script from my C drive, the email is fine; if I run it from a server the email has a blank subject and no filepath. Does anyone know why? Thank you
Code:
strRejectionsSourceFolder = "\\iseries\myfolder\"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("WScript.Shell")
'Cycle through any files in the source folder
For Each sFile In objFSO.GetFolder(strRejectionsSourceFolder).Files
'Prepare an email to notify someone of the rejection
Set myMail=CreateObject("CDO.Message")
myMail.Subject=sFile.Name
myMail.From=strRejectionsEmail
myMail.To=strRejectionsEmail
myMail.TextBody="A file has been rejected:"
myMail.TextBody= myMail.TextBody & vbcrlf & sfile.path
...set config fields and send...
… move the file…
Next
Comment