Hallo,
I'm back haha :-) so i have the next question and i hope someone can help me... I know i have a lot of questions but i will try to learn vbscript :-)
Situation: This script read out (every 5 min) the last line of a txt and send it to my eMail Address.
Problem: I'll check the txt all 5 min, but at the moment every 5 min there comes a mail. I'll try to get only a new mail, when there is something new in the txt.
Option Explicit
Dim fso, WshShell, Text, Last, objEmail
Const folder = "C:\test.txt"
Set fso=CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
Do
Text = Split(fso.OpenTextFile(Datei, 1).ReadAll, vbCrLF)
Letzte = Text(UBound(Text))
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "[email protected]"
objEmail.To = "[email protected]"
objEmail.Subject = "Control"
objEmail.Textbody = Last
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"smtpip"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
WScript.Sleep 300000
Loop
Can someone help me?
Sry for my bad english...