1.

Solve : batch file to e-mail?

Answer»

Here is the batch to e-mail FILE:
Code: [Select]:: echo off & setlocal
:: set the temp file LOCATION
set tempmail=%temp%\tempmail.%random%.txt
set /P logshort= <C:\temp\test.txt
:: echo the basic headers to the temp file
echo To: "Scripting Test" ^<[email protected]^> > %tempmail%
echo From: "myname" ^<[email protected]^> >> %tempmail%
echo Subject: Test >> %tempmail%
:: echo the BLANK line that separates the header from the body text
echo.>>%tempmail%
:: echo the body text to the temp file
type C:\temp\test.txt>> %tempmail%
:: echo Second line of body text.>> %tempmail%
:: move the temp file to the mail pickup directory
:: adjust this location for your system
move %tempmail% c:\inetpub\mailroot\pickup
set tempmail=
endlocal



Discussion

No Comment Found