ITPub博客

首页 > 数据库 > Oracle > 用脚本在windows平台发邮件

用脚本在windows平台发邮件

原创 Oracle 作者:kennyblues 时间:2007-11-21 11:28:42 0 删除 编辑

对以下脚本写成*.vbs文件,然后写一个bat文件:cscript *.vbs,用taskschedule调用。

Set objEmail = CreateObject("CDO.Message")
objEmail.From = "tpemsbrs@avon.com"
objEmail.To = "vincent.lee@avon.com,lias.liang@avon.com,kenny.wu@avon.com,benny.zhang@avon.com"
objEmail.Subject = "TPEMSBRS standby database status"
' objEmail.Textbody = Computer & " " & objLogicalDisk.DeviceID & " free disk space is " & FreeMegaBytes & "MB"
objEmail.AddAttachment "D:orascriptsdrmstandby.log"
objEmail.AddAttachment "D:orascriptsdrmposstandby.log"
objEmail.AddAttachment "D:orascriptssicsstandby.log"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"smtp server ip"
'objEmail.Configuration.Fields.Item _
' ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
' "smtp server ip"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send

[@more@]ru

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/3345/viewspace-983117/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-03-07

  • 博文量
    73
  • 访问量
    464651