Jump to Navigation

129 - How to send e-mail by Telnet

This explains how to use Telnet to test Simple Mail Transfer Protocol (SMTP) communication between messaging servers. By default,
SMTP listens on port 25. If you use Telnet on port 25, you can enter the SMTP commands that are used to connect to an SMTP server
and send a message exactly as if your Telnet session was an SMTP messaging server. You can see the success or failure of each
step in the connection and message submission process.

# telnet
> open smtp.mydomain.net 25

Trying 200.xx.xx.xx...
Connected to smtp.mydomain.net (200.xx.xx.xx).
Escape character is '^]'.
220 smtp.mydomain.net ESMTP Sendmail 8.13.8/8.13.8; Thu, 24 Dec 2009 17:14:32 -0500

EHLO myserver.mydomain.net
250-smtp.mydomain.net Hello ......, pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP

MAIL FROM: user@mydomain.net
250 2.1.0 user@mydomain.net... Sender ok
RCPT TO: user@to-domain.com
250 2.1.5 user@to-domain.com... Recipient ok

DATA
354 Enter mail, end with "." on a line by itself

Subject: Send a mail with telnet client
From: user@mydomain.net
To: user@to-domain.com
This is a test mail sent with telnet client.
.

250 2.0.0 nBOMQYbi025295 Message accepted for delivery

QUIT
221 2.0.0 smtp.mydomain.net closing connection
Connection closed by foreign host.

 

Linux:
Oracle:


Main menu 2

Story | by Dr. Radut