Community discussions

MikroTik App
 
Ackster
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 54
Joined: Wed Oct 06, 2004 6:22 pm

check staus of e-mail in script

Wed Jan 04, 2012 3:21 pm

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
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: check staus of e-mail in script

Wed Jan 04, 2012 4:11 pm

{: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.
 
Ackster
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 54
Joined: Wed Oct 06, 2004 6:22 pm

Re: check staus of e-mail in script

Wed Jan 04, 2012 5:16 pm

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 ><
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6263
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: check staus of e-mail in script

Thu Jan 05, 2012 10:34 am

you add these lines in /system script? or run them in CLI surrounded with curly braces ( ->>> {} <<--- )?
 
Ackster
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 54
Joined: Wed Oct 06, 2004 6:22 pm

Re: check staus of e-mail in script

Thu Jan 05, 2012 3:50 pm

in system script

Who is online

Users browsing this forum: No registered users and 16 guests