 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
vsefcik
Joined: 19 Aug 2008 Posts: 2 Country: United States |
|
email watch job not processing all mails? |
|
I'm testing a job that uses the schedule type "execute when email arrives". It appears that when email is processed, the body of the note is stored in the default Temp folder with the name message.txt. So, my job (VBScript) merely reads that job and display each line of text on the console using "msgbox" (the script is at the end of this note).
If I send two emails with the same subject line and different bodies, both are "read" (I use Outlook as the mail client and unread notes have a bold font, read notes are not bold, so I can see when both are "read"), but the contents are displayed by my VBScript job for only one of the notes. Is this a "feature" of an email watch job, that it can only process the contents of one mail each job "cycle" (the job is scheduled to run every minute) because the mail body is saved in the Temp folder? If so, is there any way that an email watch job can process multiple mail notes each time it runs?
Here's the crude VBScript I used for the test
sub main
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("c:\temp\message.txt", ForReading)
Const ForReading = 1
Dim arrFileLines()
i = 0
Do Until objFile.AtEndOfStream
Redim Preserve arrFileLines(i)
arrFileLines(i) = objFile.ReadLine
i = i + 1
Loop
objFile.Close
'Then you can iterate it like this
For Each strLine in arrFileLines
msgbox strLine
Next
end sub
|
|
Tue Aug 19, 2008 6:12 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
In this type of processing it can handle only one message per cycle, basically the second and other consecutive messages overwrite the message.txt file, because all messages are downloaded at once. If you need more robust email processing, use either 24x7 Event Server and make it run the VBS script directly or simply trigger a job in 24x7 Scheduler, or use 24x7 Scheduler Multi-platform Edition (MP). Both Event Server and MP can query your email server directly using POP3 protocol and they don't need local Outlook or other email client.
|
|
Tue Aug 19, 2008 7:21 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|