#SingleInstance Force
sFileName := A_Args[1] ;; 傳入參數必須帶有路徑
/*if (sFileName = "") {
MsgBox 必須傳入完整檔名
return
}
*/
pmsg := ComObjCreate("CDO.Message")
;;pmsg.Charset := "UTF-8"
pmsg.From := "datalzy2@163.com"
pmsg.To := "datalzy1@163.com"
pmsg.BCC := "" ; Blind Carbon Copy, Invisable for all, same syntax as CC
pmsg.CC := ""
pmsg.Subject := "检测到卡死出现:" . sFileName
;You can use either Text or HTML body like
pmsg.TextBody := "傳送檔名:" . sFileName
;OR
;pmsg.HtmlBody := "<html><head><title>Hello</title></head><body><h2>Hello</h2><p>Testing!</p></body></html>"
;;MsgBox %sFileName%
sAttach := sFileName ; can add multiple attachments, the delimiter is |
fields := Object()
fields.smtpserver := "smtp.163.com" ; specify your SMTP server
fields.smtpserverport := 465 ; 25
fields.smtpusessl := True ; False
fields.sendusing := 2 ; cdoSendUsingPort
fields.smtpauthenticate := 1 ; cdoBasic
fields.sendusername := "datalzy2@163.com"
fields.sendpassword := "申请的smtp密码"
fields.smtpconnectiontimeout := 60
schema := "http://schemas.microsoft.com/cdo/configuration/"
pfld := pmsg.Configuration.Fields
For field,value in fields
pfld.Item(schema . field) := value
pfld.Update()
Loop, Parse, sAttach, |, %A_Space%%A_Tab%
pmsg.AddAttachment(A_LoopField)
pmsg.Send()
08-06
06-28
08-02
3242
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
10-22
9200
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
12-26
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交