Sending SMTP mail manually using Telnet

Posted: (EET/GMT+2)

 

If you need to send an email quickly but do not have your mail client (like Eudora) available, you can use Telnet to talk directly to an SMTP server.

Connect to the mail server on port 25:

telnet mail.server.com 25

After connecting, enter the SMTP commands:

HELO server.com
MAIL FROM:<user@server.com>
RCPT TO:<recipient@domain.com>
DATA
Subject: Test message

This is a test message sent using Telnet.
.
QUIT

Note that the single dot characters on its own line ends the message.

If the server accepts the commands, the message is queued for delivery.

Knowing this is very handy for testing SMTP connectivity or sending a quick message from a minimal system.