Sending mail using Telnet

Quite often in my work I need to verify if a SMTP services is working on a server. Therefor this short post is a reminder to myself how you can send a mail with telnet.

First make sure you have telnet installed. In the Control Panel \ Programs and Features
click Turn Windows features on or off.

image

There you can see two items, Telnet Client and Telnet Server

Then you need to open the command prompt. You connect to you SMTP service by typing the following command and hit enter.

image

The localhost is the server name. You will get the following on a successful connection.

image

You can also se a new session in the SMTP manager

image

When connected to the SMTP you can use the following Telnet commands to send a mail.

HELO <domain name>
Use this command to specify from where you send the mail.

FROM MAIL:mail@example.com
From which mail address the mail should be sent from.

RCPT TO:mail@example.com
The address who will receive the mail.

DATA
A command to start typing the mail body and subject.
To add a subject to your mail you type
SUBJECT:My subject
and hit enter two times. After that you can start writing the mail body. When done with the mail body you type a single period (.) on a empty line and hit enter to send the mail.

QUIT
When you are done you type this command to quit the telnet connection and return to the command prompt.

Follow

Get every new post delivered to your Inbox.