vbs sendmail发邮件带附件方法
程序员文章站
2022-04-29 09:17:56
namespace = "http://schemas.microsoft.com/cdo/configuration/" set email...
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
上一篇: Ajax请求和Filter配合案例解析