vb发送Gmail邮件
使用vb来发送Gmail邮件,配合windows2003的performance来做进程监控,很实用也很方便,进程控制也可以,脚本的主要作用是发送邮件通知,触发动作可由performance来完成.
- Set iMsg = CreateObject("CDO.Message")
- Set iConf = CreateObject("CDO.Configuration")
- Set Flds = iConf.Fields
- schema = "http://schemas.microsoft.com/cdo/configuration/"
- Flds.Item(schema & "sendusing") = 2
- Flds.Item(schema & "smtpserver") = "smtp.gmail.com"
- Flds.Item(schema & "smtpserverport") = 465
- Flds.Item(schema & "smtpauthenticate") = 1
- Flds.Item(schema & "sendusername") = "YourEmailAddress"
- Flds.Item(schema & "sendpassword") = "YourPassWord"
- Flds.Item(schema & "smtpusessl") = 1
- Flds.Update
- With iMsg
- .To = "Recipients"
- .From = "YourName <YourEmailAddress>"
- .Subject = "Email Title"
- .HTMLBody = "YourMessageGoesHere"
- .Sender = "YourName"
- .Organization = "YourName"
- .ReplyTo = "Recipients"
- Set .Configuration = iConf
- SendEmailGmail = .Send
- End With
- set iMsg = nothing
- set iConf = nothing
- set Flds = nothing
现在还能运行吗? Gmail 允许脚本连接吗? 我测试了多次脚本都是 连不上服务器
好像不能上传附件啊
技术很强啊