Email on ping failure, Email again on ping success; Loops indefinitely; encrypted password

I was experiencing issues at a remote location. I needed to know how frequent this location was losing Internet (router), as staff had reported this being an issue here and there. We had switched from DSL to Cable, and we wanted to know if this resolved all of the problems. I was able to search my gmail through the timestamp and show that we were up and running at 99.999% uptime.

Ran the script once, and encrypted password was used as authentication. Still fairly a beginner in PowerShell, but this may be of help to someone. If anyone has suggestions, I am interested in hearing them out.

The only two lines *in* the script that need to be edited is ($IPAddress) and ($LocationTitle) . Of course I could have made these a Read-Host. Edit: Also the To, From, CC section; didn’t need to change once set personally.