Page 1 of 1

FileWatcher .vbs Script to send email

Posted: Mon May 10, 2010 1:46 pm
by DataMystic Support
Here is a sample vbscript to sent an email - save it as 'send-email.vbs' and set FileWatcher's command field to point to this file.

See also:

Code: Select all

Option Explicit

dim objArgs 

'Set a reference to the arguments
Set objArgs = Wscript.Arguments

dim objEmail
Set objEmail = CreateObject("CDO.Message")
objEmail.From = ""
objEmail.To = ""
objEmail.Subject = "FileWatcher file attached"
objEmail.Textbody = "Please process it ASAP"

for i = 1 to objArgs.count
  objEmail.AddAttachment( objArgs(i) )


set objEmail = Nothing
Set objArgs = Nothing