I use vbscript which is in turned called by a DOS .bat file (since AHP will not call a vbs file directly) to send emails / text messages. In AHP windows command, if your files are stored in c:\data\x10, put your AHP windows command as, for example: c:\data\x10\sendmail.bat Motion:_front_of_house
create file:
sendmail.bat
c:\data\x10\sendemail.vbs %1
create file:
sendemail.vbs
on error resume next
Const schema = "
http://schemas.microsoft.com/cdo/configuration/"
Const cdoBasic = 1
Const cdoSendUsingPort = 2
alertMessage = wscript.arguments(0) ' first parameter is the message to send
alertMessage = replace(alertMessage, "_", " ") ' change underscores in message to spaces
Set oMsg = CreateObject("CDO.Message")
oMsg.From = "sendingemail@gmail.com" ' or "Sender Name <from@gmail.com>"
oMsg.To = "9991112222@mms.att.net" ' destination phone number for at&t text message, other carriers have different addresses
oMsg.Subject = "Alert " & now
oMsg.TextBody = alertMessage
'GMail SMTP server configuration and authentication info
Set oConf = oMsg.Configuration
oConf.Fields(schema & "smtpserver") = "smtp.gmail.com" 'server address
oConf.Fields(schema & "smtpserverport") = 465 'port number
oConf.Fields(schema & "sendusing") = cdoSendUsingPort
oConf.Fields(schema & "smtpauthenticate") = cdoBasic 'authentication type
oConf.Fields(schema & "smtpusessl") = True 'use SSL encryption
oConf.Fields(schema & "sendusername") = "sendingemail@gmail.com" 'sender username
oConf.Fields(schema & "sendpassword") = "yourpassword1" 'sender password
oConf.Fields.Update()
'send message
oMsg.Send()