Hi,
I have a batch file which seraches for a text file and send as email attachement using smtp client sendemail.exe,below is the code for same.
for /f “tokens=* delims= ” %%a in (‘dir/b *.txt’) do (set str=%%a)
start sendemail -f frommail@domain.com -t tomail@domain.com -u Subject -m Message Body -s mail.domain.com -a %str% -xu UserName -xp Password
How can we create a log file and save the result either success or failure along with the error message?