Posted on 2009-08-01 18:11
S.l.e!ep.¢% 阅读(174)
评论(0) 编辑 收藏 引用 所属分类:
DOS
Set objEmail = CreateObject("CDO.Message")
Const CDONameSpace = "http://schemas.microsoft.com/cdo/configuration/"
With objEmail.Configuration.Fields
.Item(CDONameSpace+"sendusing") = 2
.Item(CDONameSpace+"smtpserver") = "smtp.21cn.com"
.Item(CDONameSpace+"smtpserverport") = 25
.Item(CDONameSpace+"smtpauthenticate") = 1
.Item(CDONameSpace+"sendusername") = "sleepwom"
.Item(CDONameSpace+"sendpassword") = "123456"
End With
With objEmail
.From = "sleepwom@21cn.com"
.To = "sleepwom@163.com"
.Subject = "Server down"
.Textbody = "Server1 is no longer accessible over the network."
End With
objEmail.Configuration.Fields.Update
objEmail.Send
Msgbox "success"
Set objEmail = Nothing