How to automate a telnet session with SMTP commands

I am on a Windows 2003 box, it is our last point of exit before mail leaves the environment completely.
Exchange is not installed on this box, but SMTP is.
I want to setup a batch file or something that I can schedule so that I can do a "telnet server 25" and send out a test message from this server.
currently, I am using TST10.exe but I cant get the syntax correctly.  It keeps getting stuck on the Sending Subject: part.  It never finishes.  The text I am using for the tst10.exe /r:script.txt is below.

It seems I dont know how to end the smtp command with the <CRLF>.<CRLF>

Any ideas?
server 25
wait
send "HELO domain.com\m"
wait
send "mail from:me@domain.com\m"
wait
send "rcpt to:you@domain.com\m"
wait
send "data\m"
wait "354 Start mail input; end with <CRLF>.<CRLF>"
send "subject:test\m\m"
wait
send ".\m"
wait
send "quit"
WAIT Connection to host lost.

Open in new window

travis5150Asked:
Who is Participating?
 
travis5150Connect With a Mentor Author Commented:
I found a program called mailsend.exe
It is VERY simple.
The link to the site is:
www.muquit.com/muquit/software/mailsend/mailsend.html

I created a msg.txt file and used it with the program like this:
mailsend -v < msg.txt

the msg.txt contained this:
smtp server
helo statement
from address
to address
Body of email
0
 
Michael WorshamInfrastructure / Solutions ArchitectCommented:
From looking over the code snippet above, it looks as if its actually showing the \m (carriage return) codes. I don't know if the SMTP interface can actually interpret them.

Did you look at this link for testing the SMTP interface?
http://support.microsoft.com/default.aspx?scid=kb;en-us;323350

0
 
travis5150Author Commented:
I know how to run the commands, I need to find a way to do this automatically without any interaction by me.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
travis5150Author Commented:
I request to have this question closed.
I found a different program to use and am able to work it correctly.
Thank you.
Please let me know what I need to do to have this closed.
0
 
travis5150Author Commented:
I found my own solution
0
 
Michael WorshamInfrastructure / Solutions ArchitectCommented:
If you don't mind -- can you post the solution you found so that others having the same problem can know how to solve it as well?

Thanks.

As for closing your question, see this link here:
http://www.experts-exchange.com/help.jsp#hi331
0
All Courses

From novice to tech pro — start learning today.