if this.SecurityState = 3 then ' Alarm
sTriggeredZones = "<b>Triggered Zones</b><br>" ' Heading for the email message
' Get all triggered zones
for each oZone in this.GetObjectsByTypeAndPropertyValue(Device.Security.SecurityZone.Path, "Triggered", true)
' Concatenate names of all triggered zones
sTriggeredZones = sTriggeredZones & oZone.DisplayName & "<br>"
next
' Send email
with Devices.CustomDevices.SSMTP
.MailSubject = "ATTENTION. Security System is in Alarm. " & now
.MailHTMLBody = "<h1>Security System is in Alarm.</h1>" & _
"<b>Activated: </b>" & now & "<br>" & sTriggeredZones
.MailSend = true
end with
end if