Send email when flexy offline or lose connection

Hi
i want my flexy send an email when the flexy is offline or he lose the internet connection.
How to do ?
Thank’s

@AlaeddineCHEKILI

Unfortunately, most of the time when your device goes offline then that means it has lost internet. The device will need internet to send an email.

In rare occurrences where your device does have internet but it’s offline then you can use this script to check its connection to Talk2M.

The script linked below is to check your VPN connection, however you will most definitely need internet to send an email.