I need to periodically email my registration-table so I am trying to setup a script to send the email and schedule it with the proper period.
The problem is that either I don’t get the email or I don’t get the registration-table.
The intended script is as follows:
Possibly there is smtp problem and not script output problem, althogh you say sometimes you get the email with no body right? I’d first output the command to a file, then email the file. Just a thought…
I don’t have any smtp problem 'cause if I replace the expresion by a literal the email is sent.
On the other hand when I try the following command:
/tool e-mail send to=“abel@barrionet.com.ar” subject=([/system identity get name] . " Reg Table") body=[/interface wireless registration-table get 1 signal]
from the command prompt I get the e-mail delivered ok but when I insert the same stuff as the script source the e-mail is not delivered at all.
I would try to save the output to a file but I couldn’t find how to do it in the docs.
Thank you for your help.
That’ll definitely work - I use something similar to get backups mailed:
/export file=[/system identity get name]
/tool e-mail send to=“> me@host.com> " subject=([/system identity get name] . " backup”) file=[/system identity get name]
and firewall IP list:
/ip firewall address-list print list not-in-lists file=not-in-lists
/tool e-mail send to="> me@host.com> " subject=(“Not in list - HO firewall”) file=not-in-lists.txt
How are you entering the script - through the terminal or through the /system scripts editor in winbox?
If you are pasting into the winbox editor - check for rougue characters appearing in the script - can’t think of a better word to describe them… make sure each new menu level command is on a new line… I found these to mess with the expected operation of the script…