不安装 SMTP 服务发送电子邮件[WSH][企业脚本]

王朝other·作者佚名  2006-01-09
窄屏简体版  字體: |||超大  

不安装 SMTP 服务发送电子邮件[WSH][企业脚本]

Send Email without Installing the SMTP Service

Description

Demonstration script that uses CDO to send email from a computer where the SMTP Service has not been installed. Designed to work on Microsoft's corporate network.

Script Code

Set objEmail = CreateObject("CDO.Message")

objEmail.From = "admin1@fabrikam.com"

objEmail.To = "admin2@fabrikam.com"

objEmail.Subject = "Server down"

objEmail.Textbody = "Server1 is no longer accessible over the network."

objEmail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objEmail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _

"smarthost"

objEmail.Configuration.Fields.Item _

("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objEmail.Configuration.Fields.Update

objEmail.Send

For online peer support, join the microsoft.public.windows.server.scripting community on the msnews.microsoft.com news server. To provide feedback or report bugs in sample scripts or the Scripting Guide, please contact Microsoft TechNet.

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航