vbs sendmail发邮件带附件方法
时间:2020-11-11 11:45:01|栏目:VBS|点击: 次
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实现的批量gb2312转utf-8,支持拖动
栏 目:VBS
下一篇:几段非常有用的脚本(来自微软网站,由downmoon精心收集)
本文标题:vbs sendmail发邮件带附件方法
本文地址:http://www.codeinn.net/misctech/21515.html