@echo off
set logpath=c:\scripts\logs
set my-email-address=YOUREMAIL@YOURDOMAIN.COM
set SMTP=mail.YOURMAILSERVER.COM
rem
echo %date% %time% >"%logpath%\defrag.log"
echo =================================================== >>"%logpath%\defrag.log"
echo START DEFRAG of drive C
echo --------------------------------------------------- >>"%logpath%\defrag.log"
defrag c: -f -v >>"%logpath%\defrag.log"
echo END DEFRAG of drive C
echo =================================================== >>"%logpath%\defrag.log"
echo %date% %time% >>"%logpath%\defrag.log"
rem
rem Blat - A Win32 command line SMTP mailer.
rem Use it to automatically eMail logs,
rem the contents of a html FORM,
rem or whatever else you need to send.
rem blat /? for help
rem
rem http://sourceforge.net/projects/blat/
rem
blat "%logpath%\defrag.log" -serverSMTP %SMTP% -to %my-email-address%

































