×

Loading...
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。
Ad by
  • 最优利率和cashback可以申请特批,好信用好收入offer更好。请点链接扫码加微信咨询,Scotiabank -- Nick Zhang 6478812600。

不论是否有local SMTP都可以

1. Send email with local SMTP installed:

Set objEmail = CreateObject("CDO.Message")
objEmail.From = "test1@test.com"
objEmail.To = "test2@test.com"
objEmail.Subject = "Testing"
objEmail.Textbody = "Testing..."
objEmail.Send

2. Send email without SMTP installed:
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "test1@test.com"
objEmail.To = "test2@test.com"
objEmail.Subject = "Testing"
objEmail.Textbody = "Testing..."
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"your smarthost"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
Report

Replies, comments and Discussions:

  • 工作学习 / IT技术讨论 / 请问在NT/W2K的Event Viewer中,如果有错误发生,如何让系统自动发送email通知?
    • MOM or NetIQ
      • 有免费的吗?
    • 那你得预备多大邮箱呀.
      • hehe
    • ipsentry has a free version of monitoring tool, one or two servers only, worth to try.
      • 多谢了. 问题是我的服务器不是一两个.知道Microsoft有什么工具或方法可用吗?难道要自己写代码?
        • why not? use perl Win32::lanman module. The Win32::Lanman module will allow the administrator to set and verify auditing functions as well as collect EventLog entries, and then send out an alert email.
        • or use Win32::EventLog (ships with ActivePerl), check url for some source code example...
          • 谢谢... 我用WMI Scripts写了个脚本,凑合着用了.
            • do you need to install local SMTP server for the email sending? or you can send the system message for it. I know VB script can not define SMTP server when you sending the email. (third party or .net can do it)
              • 不论是否有local SMTP都可以
                1. Send email with local SMTP installed:

                Set objEmail = CreateObject("CDO.Message")
                objEmail.From = "test1@test.com"
                objEmail.To = "test2@test.com"
                objEmail.Subject = "Testing"
                objEmail.Textbody = "Testing..."
                objEmail.Send

                2. Send email without SMTP installed:
                Set objEmail = CreateObject("CDO.Message")
                objEmail.From = "test1@test.com"
                objEmail.To = "test2@test.com"
                objEmail.Subject = "Testing"
                objEmail.Textbody = "Testing..."
                objEmail.Configuration.Fields.Item _
                ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
                objEmail.Configuration.Fields.Item _
                ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
                "your smarthost"
                objEmail.Configuration.Fields.Item _
                ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
                objEmail.Configuration.Fields.Update
                objEmail.Send
        • http://www.nagios.org/
      • I doubt ipsentry can go that level. Becasue for SMTP;POP3...maybe work. becasue they just simple ping the port number. for event log it won't work. Whatisup Gold is similar prodcut I used before.