Hi All,

I am attempting to create a small vbscript program that will check a directory to see if it has a file with todays date in it. Then the script will send an e-mail out if there isn't.

Here is the code I have so far


On Error Resume Next
Dim strPath
Dim blnFound
Set fso = CreateObject("Scripting.FileSystemObject")
strPath = Dir(pstrDir & "\*.*")
While Len(strPath) > 0 And Not blnFound
If Day(FileDateTime(pstrDir & "\" & strPath)) = Day(Now) Then
blnFound = True
End If
strPath = Dir()
Wend
CheckForTodaysFile = blnFound

If CheckForTodaysFile("M:\monitor\edi\edi\dump") Then
Set refOutlook=CreateObject("outlook.application")
sendmail=1
If err <> 0 Then
sendmail=0
End If
On Error GoTo 0
' do usefull stuff
emaildata=("The Releases have not been loaded today. Please check

their status and resolve!")
If sendmail=1 Then
Set refmailitem=refoutlook.createitem(0)
refmailitem.to="[email protected]"
refmailitem.Subject="New Realeses have not been loaded.Please

Check!!"
refmailitem.body=emaildata
refmailitem.send
Set refmailitem=nothing
Set refoutlook = Nothing
End If
End If


But it is not working. Can someone take a look and see if I am missing something.

Thanks for any help...