strMailServer = "mail.server.com" strMailFrom = "ip@email.com" strMailTo = "to@email.com" dim ArgObj, strIP Set ArgObj = WScript.Arguments 'if isArray(ArgObj) then strIP = "unknown" on error resume next strIP = ArgObj(0) on error goto 0 'else 'end if strContents = "New IP is " & strIP & "." & vbcrlf & "MailServer is " & strMailServer & "." SendEmail strContents function SendEmail(strContents) 'Dimension variables Dim objCDOSYSCon 'Create the e-mail server object Set objCDOSYSMail = CreateObject("CDO.Message") Set objCDOSYSCon = CreateObject ("CDO.Configuration") 'Out going SMTP server objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strMailServer 'SMTP port objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'CDO Port objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Timeout objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 'Update the CDOSYS Configuration Set objCDOSYSMail.Configuration = objCDOSYSCon 'Who the e-mail is from objCDOSYSMail.From = strMailFrom 'Who the e-mail is sent to objCDOSYSMail.To = strMailTo 'The subject of the e-mail objCDOSYSMail.Subject = "IP Changed" 'Set the e-mail body format (HTMLBody=HTML TextBody=Plain) objCDOSYSMail.TextBody = "IP Has Changed" & vbcrlf & now() & vbcrlf & strContents 'Send the e-mail objCDOSYSMail.Send 'Close the server mail object Set objCDOSYSMail = Nothing Set objCDOSYSCon = Nothing end function