标签:
NameSpace = "http://schemas.microsoft.com/cdo/configuration/"
Set Email = CreateObject("CDO.Message")
Email.From = "XXX@YY.com"
Email.To = "XXX@YY.com"
Email.CC = ""
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.YY.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
标签:
原文地址:http://www.cnblogs.com/ellie-test/p/4517721.html