Telnet - SMTP Commands (sending mail using telnet)

Telnet from your computer to the mail server.
    $ telnet smtp
You should receive a reply like:
    Connected to
    Escape character is '^]'.
    220 ESMTP Sendmail 8.11.6/8.11.6; Wed, 30 Jul 2003 12:27:39 +0100
If the last line is made of lots of stars with an occasional 2 or 0 then you are probably going through a Cisco PIX, and none of the extended commands will work.

You will then need to declare where you are sending the email from. You can use either standard or extended SMTP commands to do this. Extended commands allow you to see what is supported by the server and to authorize yourself:

Standard SMTP
This should give you: Hello [], pleased to meet you
Extended SMTP
This should give you: Hello [], pleased to meet you
    250 HELP

If "AUTH" is listed you can login to the server. This will usually allow some things which are normally restricted, for example relaying. You will need to use your username and password in Base64 (See here for an encoder).
    334 VXNlcm5hbWU6
    334 UGFzc3dvcmQ6
    235 2.0.0 OK Authenticated

Dont worry too much about your local domain name although you really should use your exact fully qualified domain name as seen by the outside world the mail server has no choice but to take your word for it as of RFC822-RFC1123.

Now give your email address:
    MAIL FROM: <mail@domain.ext>
The angle brackets around the name are important; some servers won't accept the name unless they are there.
Should yield:
    250 2.1.0 mail@domain.ext... Sender ok

Now give the recipients address:
    RCPT TO: <mail@otherdomain.ext>
Again, use the angle brackets.
Should yield:
    250 2.1.0 mail@otherdomain.ext... Recipient ok

To start composing the message issue the command:
    Subject:-type subject here-

then press enter twice (these are needed to conform to RFC 882)
You may now proceed to type the body of your message on as many lines as it takes. To tell the mail server that you have completed the message enter a single "." on a line by itself.
The mail server should reply with:
    250 2.0.0 ???????? Message accepted for delivery

You close the connection by issuing:
The mailserver should reply with something like:
    221 2.0.0 closing connection
    Connection closed by foreign host.

contact us
  • Name
  • Email
  • Message

Note: This information will only be used to reply to your feedback. We respect your privacy and will never abuse your email address or other personal information.

bottom corner