2 script for investigation

Good day everyone !

I have 2 problems on 2 different scripts i found on internet.
I have a hotspot server on a RB951G-2HnD and i am not using usermanager . Instead i have the ready voucher app.
I have set some logs to be send on my mail so my mail setup works fine.

The first script is https://www.mikrotik-routeros.com/2010/01/automated-usage-script-without-usermanager/ in order to have usage on users without usermanager but its not working…
Any suggest about this?

The second script is https://forum.mikrotik.com/viewtopic.php?t=69244 .
This one seems to be working but i cannot receive any mail.

Thanks in advance guys .