Page 1 of 1

Populating email BODY with output of "/print"

Posted: Mon Oct 22, 2012 2:58 am
by ScottReed
Trying to do this:
/tool e-mail send tls=yes to="someone@somewhere.com" subject="Current 172.30.6.0s-IN_USE" body="$[/ip firewall address-list print without-paging where list=172.30.6.0s-IN_USE]"
Email comes through fine but BODY is empty. Instead, the printed output is sent to the console.

How can I get the print output into the email BODY?

Thanks,
Scott

Re: Populating email BODY with output of "/print"

Posted: Mon Oct 22, 2012 7:42 am
by tomaskir
Here is an example from one of my routers that works:
send to=mail@domain.com subject="AP down" body="AP down.\r\n\r\nProblem found on $[/system clock get date] at $[/system clock get time]"

Re: Populating email BODY with output of "/print"

Posted: Mon Oct 22, 2012 11:58 am
by deejayq
i think you should use get instead of print

Re: Populating email BODY with output of "/print"

Posted: Mon Oct 22, 2012 12:28 pm
by mrz
You can't gept print output in email body. What you can is print to file and attach file to the email.

Re: Populating email BODY with output of "/print"

Posted: Mon Oct 22, 2012 8:04 pm
by ScottReed
@deejayq - "get" works great, but how do I get all the entries in a list? I'm assuming some "for" loop?

@mrz - That's what I have been doing, but i'm tired of having to open an attachment on my phone when the message arrives.

Thanks,
Scott