Search the Community
Showing results for tags 'AutoIt'.
Hello dear friends First i hope you are all fine, my problem is like you see in the topic, i've made a script with AutoIt, in order to monitor a txt file and look fro some words on it, if they exist it will send a mail. the problem is the script can't work and when i start it it run for a few seconds and it stop. Ths script is :. #include <INet.au3>$TextFileName = "C:\Users\X2Z\Desktop\youssef\Adentech\Survey_Monitor_Close_Control_130\Survey Monitor Close Control 1.30\Log.txt"$s_SmtpServer = "smtp.gmail.com"$s_FromName = "Test"$s_FromAddress = "my email"$s_ToAddress = "their email"$s_Subject = "Test test"Dim $as_Body$as_Body = "Alert"$as_Body = "Defaut"; First we read the text file$Log = FileRead($TextFileName); Put the contents into an array$pageArray = StringSplit($Log, @CRLF); Now go through the array and look for the word alarm if its found send and emailFor $i = 1 To $pageArrayIf StringInStr($pageArray[$i], "alarm") Then $Response = _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, @computername, -1)NextThank you for your help Best regards