(view source code of emaillog.bat as plain text)
@ECHO OFF
FOR /F "TOKENS=*" %%A IN (LOGFILE.LOG) DO CALL :AddLine %%A
:: The ":~6" in "%BODY:~6%" removes the "%0D%0A" at the start of the body
START mailto:sysadm@ourdomain.com?subject=Log%%20file^&body=%BODY:~6%
GOTO :EOF
:AddLine
SET LINE=
FOR %%Z IN (%*) DO CALL :AddWord %%Z
:: The ":~3" in "%LINE:~3%" removes the "%20" at the start of the line
SET BODY=%BODY%%%0D%%0A%LINE:~3%
GOTO :EOF
:AddWord
SET LINE=%LINE%%%20%1
GOTO :EOF
page last modified: 2024-04-16; loaded in 0.0065 seconds