Netwatch Multi wan script

i need help i have 3 wan in my router i need a script when a wan goes down it will generate alert like email …one thing i have a masquerade NAT srcNat rule with Wan list kindly help with this scenario as attachment is bleow…
mikrotik.png