vbs sendmail发邮件带附件方法
(编辑:jimmy 日期: 2024/12/23 浏览:3 次 )
NameSpace = "http://schemas.microsoft.com/cdo/configuration/"
Set Email = CreateObject("CDO.Message")
Email.From = "zzzevazzz@21cn.com"
Email.To = "zzzevazzz@126.com"
Email.Subject = "Test sendmail.vbs"
Email.Textbody = "OK!"
Email.AddAttachment "C:\foo.zip"
With Email.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
End With
Email.Send
Set Email = CreateObject("CDO.Message")
Email.From = "zzzevazzz@21cn.com"
Email.To = "zzzevazzz@126.com"
Email.Subject = "Test sendmail.vbs"
Email.Textbody = "OK!"
Email.AddAttachment "C:\foo.zip"
With Email.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
End With
Email.Send
下一篇:vbs实现压缩文件夹的脚本