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
send "HELO\m"
send "mail\m"
send "rcpt\m"
send "data\m"
wait "354 Start mail input; end with <CRLF>.<CRLF>"
send "subject:test\m\m"
send ".\m"
send "quit"
WAIT Connection to host lost.

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Michael WorshamStaff Infrastructure 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?;en-us;323350

travis5150Author Commented:
I know how to run the commands, I need to find a way to do this automatically without any interaction by me.
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.
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

travis5150Author Commented:
I found my own solution
Michael WorshamStaff Infrastructure 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?


As for closing your question, see this link here:
travis5150Author Commented:
I found a program called mailsend.exe
It is VERY simple.
The link to the site is:

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.