• RSS
  • Twitter
  • FaceBook

Security Forums

Log in

FAQ | Usergroups | Profile | Register | RSS | Posting Guidelines | Recent Posts

Sending Mail in a Batch File

Users browsing this topic:0 Security Fans, 0 Stealth Security Fans
Registered Security Fans: None
Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More

View previous topic :: View next topic  
Author Message
TheKingster
Link Spammer
Link Spammer


Joined: 03 May 2002
Posts: 0
Location: UK

Offline

PostPosted: Thu Jan 16, 2003 11:24 am    Post subject: Sending Mail in a Batch File Reply with quote

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?
Back to top
View user's profile Send private message
ShaolinTiger
Forum Fanatic
Forum Fanatic


Joined: 18 Apr 2002
Posts: 16777215
Location: Kuala Lumpur, Malaysia

Offline

PostPosted: Thu Jan 16, 2003 11:39 am    Post subject: Reply with quote

This has been discussed in the forum at least 3 times Razz

Use blat Very Happy
Back to top
View user's profile Send private message Visit poster's website
TheKingster
Link Spammer
Link Spammer


Joined: 03 May 2002
Posts: 0
Location: UK

Offline

PostPosted: Thu Jan 16, 2003 1:07 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
ThePsyko
SF Mod
SF Mod


Joined: 17 Oct 2002
Posts: 16777178
Location: California

Offline

PostPosted: Thu Jan 16, 2003 5:37 pm    Post subject: Reply with quote

postie! postie! postie!

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

blat vs postie Smile
Back to top
View user's profile Send private message Send e-mail
ShaolinTiger
Forum Fanatic
Forum Fanatic


Joined: 18 Apr 2002
Posts: 16777215
Location: Kuala Lumpur, Malaysia

Offline

PostPosted: Thu Jan 16, 2003 5:53 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
ThePsyko
SF Mod
SF Mod


Joined: 17 Oct 2002
Posts: 16777178
Location: California

Offline

PostPosted: Fri Jan 17, 2003 9:38 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   

Post new topic   Reply to topic   Printer-friendly version    Networking/Security Forums Index -> Programming and More All times are GMT + 2 Hours
Page 1 of 1


 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Looking for more Windows Networking info?

Sign up to the WindowsNetworking.com Monthly Newsletter, written by Enterprise Security MVP Deb Shinder, containing news, the hottest tips, Networking links of the month and much more. Subscribe today and don't miss a thing!
View a sample newsletter.

Become a WindowsNetworking.com member!

Discuss your Windows Networking issues with thousands of other Windows Newtorking experts. Click here to join!

Community Area

Log in | Register

Readers' Choice

Which is your preferred data recovery solution?

Follow TechGenix on Twitter