here is an example of how to send en email.
Not exactly the same but should work with a little modification to make yours work
sendto = (" -To 5156815555@email.domain.net")
sendfrom = (" -From nimsof@domain.com")
smtpserver = (" -SmtpServer iport1.domain.com")
command = ("\nPowershell")
sendcommand = (" Send-MailMessage")
-- Fetch all critical alarms, place in table 'al'.
al=alarm.list("severity","critical")
if al ~= nil then
for i=1,#al do
-- Place current row al[i] into a (for readability)
a=al[i]
-- Add hostname, severity, arrival time and message to variable
subject = (" -Subject".." {"..a.severity.." alert".."}")
emailbody = (" -Body".." \"".."`r`n'"..a.hostname.."'".."`r`n'"..a.time_arrival.."'".."`r`n'"..a.message.."'".."\"")
end
end
--send SMTP alert
--printf(command..sendcommand..sendto..sendfrom..smtpserver..subject..emailbody)
action.command(command..sendcommand..sendto..sendfrom..smtpserver..subject..emailbody)
Basically you have to get the alarm message into a variable and add it in BEFORE the action command line.