NameSpace = "http://schemas.microsoft.com/cdo/configuration/"
Set Email = CreateObject("CDO.Message")
Email.From = "sender@xx.com"
Email.To = "receiver@xx.com"
Email.CC = "cclist@xx.com"
Email.Subject = "mail subject"
Email.Textbody = "OK!"
Email.AddAttachment "C:\111.txt"
Email.Configuration.Fields.Item(NameSpace &"sendusing") = 2
Email.Configuration.Fields.Item(NameSpace & "smtpserver")= "smtp.xx.com"
Email.Configuration.Fields.Item(NameSpace & "smtpserverport")= 25
Email.Configuration.Fields.Item(NameSpace & "smtpauthenticate") = 1
Email.Configuration.Fields.Item(NameSpace & "sendusername")= "username"
Email.Configuration.Fields.Item(NameSpace & "sendpassword")= "password"
Email.Configuration.Fields.Update
Email.Send
VBS使用SMTP协议发送邮件
最新推荐文章于 2019-12-25 16:13:29 发布