Not sure whats wrong with it, but it seems badly written.
It runs the same many times. Store time to a variable, then use it instead of getting time in same format many times.
It seems that a ** is missing for the first line.
Why use fulle syntax here:
[/system clock get date]
Then later shorten it:
[/sys cl get date]
But why send logs to email, use syslog and send it to an external server eks Splunk.
See my post here:
http://forum.mikrotik.com/t/using-splunk-to-analyse-mikrotik-logs/105668/1
This should do the same:
: local filename ([/system identity get name] . "Log-" . [:pick [/system clock get date] 7 11] . [:pick [/system clock get date] 0 3] . [:pick [/system clock get date] 4 6].".txt")
/log print file="$filename"
/tool e-mail send to="<your email here>" subject="$filename" file="$filename" body="log files"
:delay 10s
/file rem "$filename"
: log info "System Log emailed at $filename"