本帖最后由 czjt1234 于 2013-3-31 16:40 编辑
- NameSpace = "http://schemas.microsoft.com/cdo/configuration/"
- set Email = CreateObject("CDO.Message")
- Email.From = "646397053@qq.com"
- Email.To = "thisexplorer@qq.com"
- Email.Subject = "来自 IP 来自:上海市 电信【101.229.24.63】的信息"
- x="C:\fung.7z"
- y="C:\fung.7z"
- Set fso=CreateObject("Scripting.FileSystemObject")
- Set myfile=fso.OpenTextFile(x,1,Ture)
- c=myfile.readall
- myfile.Close
- Email.HTMLbody = Replace("这里是正文" &vbCRLf & c, vbCrLf ,"<br>")
- Email.AddAttachment y
- with Email.Configuration.Fields
- .Item(NameSpace&"sendusing") = 2
- .Item(NameSpace&"smtpserver") = "smtp.qq.com"
- .Item(NameSpace&"smtpserverport") = 25
- .Item(NameSpace&"smtpauthenticate") = 1
- .Item(NameSpace&"sendusername") = "646397053"
- .Item(NameSpace&"sendpassword") = "**************"
- .Update
- end with
- Email.Send
- Set Email=Nothing
复制代码 没测试,你试试看 |