telnet

From RaySoft

The telnet command is used to communicate with another host using the TELNET protocol.[1]

Documentation

Examples

Send a email directly to a SMTP server using telnet
telnet mail.raysoft.loc 25
220 mail.raysoft.loc ESMTP

HELO oxygen.raysoft.loc
250 mail.raysoft.loc Hello oxygen.raysoft.loc [10.0.0.101]

MAIL FROM: <alex@raysoft.loc>
250 <alex@raysoft.loc> is syntactically correct

RCPT TO: <melman@raysoft.loc>
250 <melman@raysoft.loc> verified

DATA
354 Enter message, ending with "." on a line by itself
From: Alex the Lion <alex@raysoft.loc>
To: Melman the Giraffe <melman@raysoft.loc>
Subject: Who are you?

Hi Melman,
Who are you?

C U,
Alex
.
250 OK

QUIT
221 mail.raysoft.loc closing connection
Send a email directly to a SMTP server with authentication using telnet
echo -en '\0alex@raysoft.loc\0********' | openssl enc -base64

Output:

AGFsZXhAcmF5c29mdC5sb2MAKioqKioqKio=
telnet mail.raysoft.loc 25
220 mail.raysoft.loc ESMTP

EHLO oxygen.raysoft.loc
250 mail.raysoft.loc Hello oxygen.raysoft.loc [10.0.0.101]
250-SIZE 52428800
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP

AUTH PLAIN AGFsZXhAcmF5c29mdC5sb2MAKioqKioqKio=
235 Authentication succeeded

MAIL FROM: <alex@raysoft.loc>
250 <alex@raysoft.loc> is syntactically correct

RCPT TO: <melman@raysoft.loc>
250 <melman@raysoft.loc> verified

DATA
354 Enter message, ending with "." on a line by itself
From: Alex the Lion <alex@raysoft.loc>
To: Melman the Giraffe <melman@raysoft.loc>
Subject: Who are you?

Hi Melman,
Who are you?

C U,
Alex
.
250 OK

QUIT
221 mail.raysoft.loc closing connection

References

  1. man 1 'telnet'