check staus of e-mail in script

Is there a way to check the status of sending a e-mail in a script. The CLI allows /tool e-mail status, but I can’t figue out how to assign that to a variable in a script.

:local i [/tool e-mail status]; #does not work

Also, tried different variations on the above command with no success.

Thanks in advance

{:local lala [/tool e-mail status]; :put $lala;}

with :pick you can trim the output to your liking.

Note that in console when you write one line then that is whole script. use curly braces to ensure that you make your script longer, since :local variables work only inside of one script.

Thanks for quick response. CLI works great in script giving me issues.

:log info (“start”);
:local lala [/tool e-mail status];
:log info (“end >$lala<”);


Shows in log end ><

you add these lines in /system script? or run them in CLI surrounded with curly braces ( ->>> {} <<— )?

in system script