mail (smtp) using telnet batch script

Status
Not open for further replies.
Hello,

I'm have to find/make something to test a list of +- 40 servers (on different locations) on mail relay. My idea was to make a little batch script that tries to send a mail (to myself) using telnet (telnet <server name> 25, helo etc, etc.).

Now my problem is that i can't find a way to let him check a different server everytime.
So my first question is: is there a way to do this, or do i need to copy/paste the same steps (telnet <server> 25, helo etc, etc) 40 times and change the server name everytime?

second question is: can i delay the input of my batch file? 'cos otherwise the server doesn't get all the commands 'cos the input is faster than he can handle it.

tnx in advance,
Jori


/edit
found a way to delay things (call in another batch scripts that uses ping -w)
 
Argument passing to batch script

You can use biterscripting for passing different server to the script each time.

You script may have something like this.

Code:
# Script TestServer
var str server
telnet $server
# End of script

You save this script in file C:\Scipts\TestServer.txt.

Then call this script as follows.

Code:
script TestServer.txt server("server1")

script TestServer.txt server("server2")

etc.

You can even put a list of servers in a file, and call the script for one server at a time automatically. What's best is that you can parse the output using biterscripting editors to automate server state checking also.

biterscripting (biterscripting.com) is free scripting language. It seems to offer a bit more flexibility than batch. If you install it, make sure you follow the installation instructions posted at their web site.

Patrick
 
SMTP is FAR MORE than just a connection; If your goal is to show that the
server is accepting connections, then the telnet servername 25 is sufficient.
Otherwise you need to master the protocol.

Perl and PHP have prepackaged modules which will manage the protocol and
your scripts provide Server Name, Sendto: Subject: and Body text.
 
Status
Not open for further replies.
Back