|
::----------------------------------------------------------------------------- :: MailSender usage script example ::----------------------------------------------------------------------------- @echo off SET MS=mailsender.exe SET FROM=yourname@yourhost.com SET SMTP=smtp.yourhost SET USNAME=username :: Prepare message text @echo This is test message! >msg.txt :: Prepare user addesses list @echo user1@gmail.com >toaddr.txt @echo user2@gmail.com >>toaddr.txt @echo user3@gmail.com >>toaddr.txt :: Prepare attachment file @dir >attachfile.txt :: and attachments file... @echo attachfile.txt >attach.txt :: Now run MailSender and try send message %MS% /B:msg.txt /T:toaddr.txt /F: %FROM% /SMTP:%SMTP% /U:%USNAME% "/S:This is subject" /A:attach.txt :: Check errors if errorlevel 5 goto er5 if errorlevel 4 goto er4 if errorlevel 3 goto er3 if errorlevel 2 goto er2 if errorlevel 1 goto er1 goto noerr :er5 @echo Error send message by client! goto done :er4 @echo Error in application! goto done :er3 @echo Error! Host not found! goto done :er2 @echo Error! Send message failed! goto done :er1 @echo Error! SMTP server not found! goto done :noerr @echo Success! :done |