Sending Mail in a Batch File

Networking/Security Forums -> Programming and More

Author: TheKingsterLocation: UK PostPosted: Thu Jan 16, 2003 11:24 am    Post subject: Sending Mail in a Batch File
    ----
Does anyone know if there is anyway to send an e-mail via a batch file?

You cant use SMTP commands as its in a session as soon as you telnet.

Is there any other way?

Author: ShaolinTigerLocation: Kuala Lumpur, Malaysia PostPosted: Thu Jan 16, 2003 11:39 am    Post subject:
    ----
This has been discussed in the forum at least 3 times Razz

Use blat Very Happy

Author: TheKingsterLocation: UK PostPosted: Thu Jan 16, 2003 1:07 pm    Post subject:
    ----
Got a few brownie points for this:

Code:

@echo off
REM Batch file by Dave King to ensure ********* services are ok.
REM Please do not delete this file or remove from scheduled tasks!

@echo This mail has been sent to you because some of the Spaceseeker services needed starting > C:\Logfile.log
@echo. >> C:\Spaceseeker.log

REM Starting Publishing service
net start "FTP Publishing service" >> C:\Logfile.log

REM Starting IIS Admin Service
net start "IIS Admin Service" >> C:\Logfile.log

REM starting SMTP Service
net start "Microsoft SMTP service" >> C:\Logfile.log

REM Starting WWW Publishing service
net start "World Wide Web Publishing Service" >> C:\Logfile.log

REM Check if email needs to be sent
find "service is starting" c:\Logfile.log > nul
if errorlevel 1 goto end

REM Send mail
if exist %systemroot%\blat.exe blat -install smtp.btclick.com email@emaildomain.co.uk
if exist %systemroot%\blat.exe blat c:\Logfile.log -t email@emaildomain.co.uk

:end



Of course I have amended the to address and SMTP server for this post, these are not actually the ones I am using.

You may think it looks very simple and doesn't actually do much, but is very effective, which is what counts.

Thanks Shaolin for the pointer to blat.

Author: ThePsykoLocation: California PostPosted: Thu Jan 16, 2003 5:37 pm    Post subject:
    ----
postie! postie! postie!

One of these days ST and I are going to have to have a CL mail-off

blat vs postie Smile

Author: ShaolinTigerLocation: Kuala Lumpur, Malaysia PostPosted: Thu Jan 16, 2003 5:53 pm    Post subject:
    ----
LOL

Don't make me b0mb0r j00!

SpankTP.bat..

Code:
:0WN3D
ECHO Hehe
blat d0nkeypr0n.mpg -t tp@prozac.com
goto 0WN3D-2

:0WN3D-2
ECHO Oops infinite loop.
blat d0nkeypr0n.mpg -t tp@prozac.com
goto 0WN3D

Author: ThePsykoLocation: California PostPosted: Fri Jan 17, 2003 9:38 pm    Post subject:
    ----
heh.. you'd be b0mb0ring j00rself - that email account only has a 500Kb size limit before it starts bouncing... I'll never see teh d0nkey pr0n Sad



Networking/Security Forums -> Programming and More


output generated using printer-friendly topic mod, All times are GMT + 2 Hours

Page 1 of 1

Powered by phpBB 2.0.x © 2001 phpBB Group