ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Send an email when remote computer is not in use

<< < (2/2)

techidave:
why not use the chat feature to ask them if now is ok that is built into VNC after you have remoted in? 

BigVent:
Here's a very quick example of what you needed.

Notes:

* Timer is set to fire after 45 minutes of idle time (adjust as needed)
* Should the program then exit after it fires? (I'm not sure how often you needed notices so I'll leave that up to you)
* Easy email send via COM - adjust your email & credentials

Enjoy!


--- Code: Autohotkey ---#SingleInstance, force#Persistent time := 2700000 ;//45 minutes SetTimer, check, 300000 ;//check once every 5 minreturn check:        if(A_TimeIdle >= time)        {                email()                SetTimer, check, off        }return ;//function emailemail(){        pmsg                    := ComObjCreate("CDO.Message")        pmsg.From               := "[email protected]"        pmsg.To                 := "[email protected]"        pmsg.BCC                := ""   ; Blind Carbon Copy, Invisable for all, same syntax as CC        pmsg.CC                 := ""        pmsg.Subject    := "PC in question is idle"         ;You can use either Text or HTML body like        pmsg.TextBody   := A_Username " 's PC is idle."        ;OR        ;pmsg.HtmlBody := "<html><head><title>Hello</title></head><body><h2>Hello</h2><p>Testing!</p></body></html>"         ;var := A_ScriptDir        ;msgbox % var        ;"%SPVvar%"|"%VPNvar%"        ;SPVvar := A_ScriptDir "\blah.txt"        ;VPNvar := A_ScriptDir "\blah1.txt"         sAttach                 = ;%SPVvar%|%VPNvar%                  ; can add multiple attachments, the delimiter is |         fields := Object()        fields.smtpserver   := "smtp.gmail.com" ; specify your SMTP server        fields.smtpserverport     := 465 ; 25        fields.smtpusessl      := True ; False        fields.sendusing     := 2   ; cdoSendUsingPort        fields.smtpauthenticate     := 1   ; cdoBasic        fields.sendusername := "[email protected]"        fields.sendpassword := "password12345"        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()        return} esc::        critical        exitappreturn

Navigation

[0] Message Index

[*] Previous page

Go to full version