Sending SMTP Email to Exchange using Telnet

20 08 2009

Open your telnet client and connect to your Exchange server on port 25

Microsoft Telnet> open exchange.mydomain.local 25 

And you’ll see a response like this;

220 exchange.mydomain.local Microsoft ESMTP MAIL Service, Version: 6.0.3790.3959 ready at Thu, 20 Aug 2009 12:03:39 +0100

Type the HELO (or EHLO) command;

250 exchange.mydomain.local Hello [192.168.1.2]

Now to begin your message, enter who the message is from;

mail from:phil.harding@mydomain.local
250 2.1.0 phil.harding@mydomain.local....Sender OK

Enter the message recipient;

rcpt to:phil.harding@me.com
250 2.1.5 phil.harding@me.com

Now for the subject and message part of the message;

data
354 Start mail input; end with .
subject:This is a test
Hello from me to you
This is a line
.
250 2.6.0 <EXCHANGEWtIIZS2TRqf0000000a@exchange.mydomain.local%gt; Queued mail for delivery

The last line displayed confirms that your message has been received by the SMTP server and is queued for delivery.

See this post for more information on Exchange HELO/EHLO commands.





Sending Email using Telnet with SMTP Authentication

4 03 2009

Sending email with Telnet using SMTP commands is an easy way to test your SMTP server solution, sometimes however you need to authenticate yourself to the SMTP server, or your relay server needs to authenticate itself to the onward SMTP server, here’s a nice link which explains how to do it.

If you’re using Windows, you can use the Telnet application, if you’re using a Mac you can use Terminal, once Terminal is running, run the telnet command as normal e.g.

telnet servername port-number