I set up a performance alert in Windows 2003 SP1 to monitor logical drive space. I'm looking for a way to have the alert when triggered to email me. I did a quick google search and found this site - http://www.windowsitpro.com/Articles/ArticleID/24594/24594.html?Ad=1
I downloaded the code, changed the values it describes in the article and tried to run it with no success. I get "Unexpected XML declaration - declaration must be at the beginning of the file".
So i remove the first line so it's now <?xml version="1.0"?>. now i get this error " The message could not be sent to the SMTP server. The transport error code was 0x80040217. The server response was not available."
here is the full code, maybe someone can tell me if there is an obvious error in the code. I don't know VB at all.
Dim objArgs, strMsgBody, iMsg, iConf, Flds
Set objArgs = WScript.Arguments
If objArgs.Count > 0 Then
strMsgBody = objArgs(0)
Set iMsg = CreateObject("CDO.Message"
Set iConf = iMsg.Configuration
Set Flds = iConf.Fields
Flds(cdoSendUsingMethod) = cdoSendUsingPort
Flds(cdoSMTPServer) = "10.10.1.4"
Flds(cdoSMTPServerPort) = 25
out) = 10
Flds(cdoSMTPAuthenticate) = cdoBasic
Flds(cdoSendUserName) = ""
Flds(cdoSendPassword) = ""
Set .Configuration = iConf
.To = "firstname.lastname@example.org"
.From = "email@example.com"
.Subject = "Windows 2000 Performance Alert"
.TextBody = strMsgBody
WScript.Echo "Send mail completed."