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 sendmail发邮件带附件方法】的全部内容了,欢迎留言评论进行交流!