borup Posted March 27, 2008 Share Posted March 27, 2008 (edited) Hi all. I have try to make an application theres checks the folder c:\download\*.log - need the script to include sub folders also.... - only send the email once for the same file , with the full file name included (more than one file with the same file extension could come) - the script should not exit but keep checking the folders can anone help me? /T This is the code I have so far. expandcollapse popupWhile 1 If FileExists("C:\download\*.log") Then MsgBox(4096, "File exists", "File exists",5) $file = FileOpen("C:\download\email.vbs", 1) $To = "myemail@hotmail.com" $From = "noone@blackhole.com" $Subject = "Your Subject Here" $TextBody = "What you want in plain text!!!" $SMTP = "smtp.mail.dk" FileWriteLine($file, 'set imsg = createobject("cdo.message")') FileWriteLine($file, 'set iconf = createobject("cdo.configuration")') FileWriteLine($file, ' ') FileWriteLine($file, 'Set Flds = iConf.Fields') FileWriteLine($file, 'With Flds') FileWriteLine($file, '.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2') FileWriteLine($file, '.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "' & $SMTP & '"') FileWriteLine($file, '.Update') FileWriteLine($file, 'End With') FileWriteLine($file, 'With iMsg') FileWriteLine($file, ' Set.Configuration = iConf') FileWriteLine($file, ' .To = "' & $To & '"') FileWriteLine($file, ' .From = "' & $From & '"') FileWriteLine($file, ' .CC = ""') FileWriteLine($file, ' .Subject = "' & $Subject & '"') FileWriteLine($file, ' .TextBody = "' & $TextBody & '"') FileWriteLine($file, ' .fields.update') FileWriteLine($file, ' .Send') FileWriteLine($file, 'End with') FileWriteLine($file, 'set imsg = nothing') FileWriteLine($file, 'set iconf = nothing') FileClose($file) Sleep(1000) ; Run("wscript.exe C:\email.vbs", "C:\") Sleep(2000) FileDelete("C:\download\email.vbs") Exit EndIf Sleep(1000) WEnd Edited March 27, 2008 by borup Link to comment Share on other sites More sharing options...
Zedna Posted April 1, 2008 Share Posted April 1, 2008 For emailing look at InetSmtMailCOM UDF For recursive filesearch look at _FileSearch or _FileListToArrayEx UDFs Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now