Using CURL command output to send email notification. I have a below code which will check multiple URLs from a txt file as a input parameter and send the output as a email notification if it is failing. But my code is not sending mails for the error status.
@echo off
@for /F "usebackq delims=" %%I in ("%~dp0URL.txt") do @curl.exe -i "%%I"
pause
URL.txt content:
http://dummy.restapiexample.com/api/v1/employees; http://dummy.restapiexample.com/api/v1/employee/1; http://dummy.restapiexample.com/api/v1/create
I want to check like:
If the URL is down, it should send mail notification with the error logs (blat -subject "App Status" -body "App is Down, please find the attachment for the error logs" -attach sample.txt -to emailID