There may be instances where you need to automatically send a message from some type application or program. Or, you may want to
send yourself an alert when a service suddenly stops on one of your critical Windows 2003 Server. Without some type of monitoring
application or agent running on the system, you'll need some type of custom program or script to send out a message with pertinent
Here is an example of a script that uses CDO to send an email message from a computer using a remote SMTP server. Replace
"smtp.mydomain.com" with the hostname of the SMTP server that you will be sending mail through. You can modify the other
properties such as who the mail is from and who the mail is being sent to. Just copy and paste into a text editor such as
Notepad, then save with the extention of .vbs.
|Set objEmail = CreateObject("CDO.Message")|
objEmail.From = "firstname.lastname@example.org"
objEmail.To = "email@example.com"
objEmail.Subject = "Service Is Down"
objEmail.Textbody = "The Service ### has stopped."
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Recommended Books & Training Resources