> ok i am not too good at this so i have a nice crisp $20.00  for a
> good working script that i can schedule to run and have it email me
> the counters.
>
Rhett,

I made a correction, added more notes, and added optional SMTP
Authentication.
Just cut, paste, read, edit.


Mike


---------------------------------------------------------------
' Corrections
' 1. Changed Server.CreateObject to CreateObject
'    We are using VbScript not ASP
' 2. Added optional SMTP Authentication
'
'Save text in a file with a .vbs extension
'
'Get the IISSample.RegistryAccess component here:
'http://www.microsoft.com/ntserver/nts/downloads/archive/IISRegistryAccess/d
efault.asp
'
'You might have to register the component manually
'C:\>regsvr32 \winnt\system32\reg.dll
'
' Set KeyName below to the path of the counter you wish to retrieve
' Set UseSmtpAuthentication = 0 if authentication is not needed
' Set UseSmtpAuthentication = 1 for authentication
' Replace [EMAIL PROTECTED] with your email address
' Replace smtp.YourDomain.com with the name of your smtp server
' Replace YourUsername with your smtp authentication username
' Replace YourPassword with  your smtp authentication password
'

Dim KeyName
Dim CounterValue
Dim Registry
Dim objEmail
Dim UseSmtpAuthentication

UseSmtpAuthentication = 1
KeyName = "HKEY_LOCAL_MACHINE\Software\Ipswitch\IMail\Global\InstOptions"

Set Registry = CreateObject("IISSample.RegistryAccess")
  CounterValue = Registry.Get( KeyName )
Set Registry = Nothing

Set objEmail = CreateObject("CDO.Message")
  objEmail.From = "[EMAIL PROTECTED]"
  objEmail.To = "[EMAIL PROTECTED]"
  objEmail.Subject = "Counter Values"
  objEmail.Textbody = "Counter Values: " & CounterValue
  objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/confi
guration/sendusing") = 2
  objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/confi
guration/smtpserver") = "smtp.YourDomain.com"
  objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/confi
guration/smtpserverport") = 25
  If UseSmtpAuthentication Then
    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con
figuration/smtpauthenticate") = 1
    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con
figuration/smtpaccountname") = "[EMAIL PROTECTED]"
    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con
figuration/sendemailaddress") = "<[EMAIL PROTECTED]>"
    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con
figuration/smtpuserreplyemailaddress") = "<[EMAIL PROTECTED]>"
    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con
figuration/sendusername") = "YourUsername"
    objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/con
figuration/sendpassword") = "YourPassword"
  End If
  objEmail.Configuration.Fields.Update
  objEmail.Send
Set objEmail = Nothing
---------------------------------------------------------------




To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html
List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/

Reply via email to