Sending email using telnet

Every admin knows as to use telnet to test remote port connectivity. But did you know that you can use this command in more ‘creative’ manners ?

For example to send mail in a fully manual mode:

# telnet localhost smtp
Connected to localhost.
Escape character is '^]'.
220 ESMTP Exim 4.72 Mon, 16 Jan 2012 12:56:06 +0100
250 Hello localhost [::1]
mail from:
250 OK
rcpt to:
250 Accepted
354 Enter message, ending with "." on a line by itself
Hey genius buddy
This is a test!
250 OK id=1cT5uM-0001oK-Dm
221 closing connection
Connection closed by foreign host.