Home > mail > How to send emails with telnet | About

You need to say who you are first, then specify the sender's address, the recipients address, then the subject of your mail and the mail itself. You must tell the SMTP server that you're going to actually send it the mail itself with the DATA command.

Let's recap in 7 easy steps :

  - telnet smtpserver 25 
  - EHLO yourdoamin.tld                       < ----- Tell the server who you are
  - MAIL FROM: sendersaddress@domain.tld      < ----- Who is sending the email
  - RCPT TO: recipientsaddress@domain.tld     < ----- To whom ? 
  - DATA                                      < ----- I am on my way to send you the actual email
  - SUBJECT: your subject goes here          
  - Then type the body of the message and end it with a line containing only one dot '.'
  - Done :) 

Here's an example session

ychaouche@XXX ~ $ telnet 10.10.10.19 25
Trying 10.10.10.19...
Connected to 10.10.10.19.
Escape character is '^]'.
220 *******************************************************
EHLO localhost.localdomain
250-messagerie.XXX.tld
250-PIPELINING
250-SIZE
250-VRFY
250-ETRN
250-XXXXXXXA
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM:moi@XXX
250 2.1.0 Ok
RCPT TO: a.chaouche@XXX
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
SUBJECT: comment envoyer un mail avec telnet

Etape 1 : telnet mailhost port 25
EHLO mondomain.montld
MAIL FROM: l'addresse de l'émetteur, ici le spoofing se pose.
RCPT TO: ici l'addresse du destinateur
DATA 
SUBJECT: le sujet du message

(deux fois entrée)
ENsuite on tape le message le plus normalement du monde.
Pour terminer le message écrire une ligne avec seulement un point (.)
.
250 2.0.0 Ok: queued as F0EDC148835B
421 4.4.2 messagerie.XXX.tld Error: timeout exceeded
Connection closed by foreign host.
ychaouche@XXX ~ $ 

contact : @ychaouche yacinechaouche at yahoocom


QR Code
QR Code telnetmail (generated for current page)