Table of Contents

Sending eMail Using Telnet (SMTP Commands)

If you ever find yourself in a situation where you have to test a mail server via telnet, here is how you do it.

In order to access your mailbox you will need 2 things:

The first thing to do is to open a connection from your computer to your mail server.

Several errors and explanations

501 nouser@nosuchplace.here… Sender domain must exist - The domain that you are sending from must exist 503 Need MAIL before RCPT - A recipient has been specified before a sender. 550 mail@domain.ext… Relaying Denied - The mail server has refused to relay mail for you, this may be for any number of reasons but typical resons include:

Some things to watch out for:

  1. If you type too quickly, sometimes it won't recognise your text
  2. The backspace key sometimes does not work with some telnet clients (even though it may seem as though it does)

Here is c/p from telnet (commands and output)

220 mail.example.com ESMTP Service (Lotus Domino Release 8.5.3FP5) ready at Thu, 27 Nov 2014 15:48:55 +0100
HELO domain.com
250 mail.example.com Hello domain.com ([10.238.90.163]), pleased to meet you
MAIL FROM: user@domain.com
250 user@domain.com... Sender OK
RCPT TO: anotheruser@anotherdomain.com
250 anotheruser@anotherdomain.com... Recipient OK
DATA
354 Enter message, end with "." on a line by itself
Subject:Test

Body
another line
.
250 Message accepted for delivery
quit
221 mail.example.com SMTP Service closing transmission channel


Connection to host lost.