vbs sendmail发邮件带附件方法
程序员文章站
2024-01-15 23:22:16
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
上一篇: JS变量及其作用域
下一篇: 脚本编程 4 驱动器