vbs sendmail发邮件带附件方法
发布时间:2016-12-28 来源:查字典编辑
摘要:NameSpace="http://schemas.microsoft.com/cdo/configuration/"SetEmail=Cr...
NameSpace="http://schemas.microsoft.com/cdo/configuration/"
SetEmail=CreateObject("CDO.Message")
Email.From="zzzevazzz@21cn.com"
Email.To="zzzevazzz@126.com"
Email.Subject="Testsendmail.vbs"
Email.Textbody="OK!"
Email.AddAttachment"C:foo.zip"
WithEmail.Configuration.Fields
.Item(NameSpace&"sendusing")=2
.Item(NameSpace&"smtpserver")="smtp.21cn.com"
.Item(NameSpace&"smtpserverport")=25
.Item(NameSpace&"smtpauthenticate")=1
.Item(NameSpace&"sendusername")="zzzevazzz"
.Item(NameSpace&"sendpassword")="ph4nt0m!"
.Update
EndWith
Email.Send