Get a "/ip address print" output by mail

Hello
is there a way to have /ip address print output by mail ?

I tried with

:log info "Invio lista IP a my@email.address...";
:local ipARRAY [/ip addressprint]
:log info $ipArray;
                        
 /tool e-mail send to="my@email.address" subject="Lista indirizzi IP $[/system identity get name] - $[/system clock get date] $[/system clock get time] " body="Elenco indirizzi IP $ipArray"

I still get an empty variable ipARRAY.

Thank you for your help

You can receive address list as array by assigning it to variable:

“:global addrlist [/ip address print as-value]”

You can also:

  1. save /ip address print output to file:
    /ip address print file=address
  2. set file content as variable
    :local a [file get address.txt contents ]
  3. Send text output to mail.
    body=“Elenco indirizzi IP $a”

for example:

{/ip address print file=address;:local a [file get address.txt contents ]; tool e-mail … body=“Elenco indirizzi IP $a” }

Thank you, I solved !
It’s not so good to view but it’s enough for me !

Thanks again

If You save print output to file, it should look the same as print command output. Just won’t look good only if you print file content to terminal.

You’ll burn the flash.