- Open your command prompt.
- Now, connect with telnet using the following command:
telnet example.com 25
- Type ehlo example.com. Some servers also accept helo in place of ehlo.
ehlo example.com
- Type mail from: username@example.com:
mail from: username@example.com
- Type rcpt to: friend@hotmail.com, friend2@yahoo.com (replace with your actual recipient name):
rcpt to: friend@hotmail.com, friend2@yahoo.com
- To write the message - type data, followed by your subject and message. To end the message, put a period on a line by itself and press enter:
data Subject: My Telnet Test Email Hello, This is an email sent by using the telnet command. Your friend, Me .
- Type quit to exit telnet.
Sample:
[c:\~]$ telnet 138.35.54.172 25
Connecting to 138.35.54.172:25...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
220 smtpx.svcs.hpe.com ESMTP Postfix
500 5.5.2 Error: bad syntax
500 5.5.2 Error: bad syntax
ehlo 138.35.54.172
250-smtpx.svcs.hpe.com
250-PIPELINING
250-SIZE 31457280
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: xia@hpe.com
250 2.1.0 Ok
rcpt to: xia@hpe.com
250 2.1.5 Ok
data
502 5.5.2 Error: command not recognized
data
354 End data with <CR><LF>.<CR><LF>
Subject: Test mail
Hellow ord!!!
.
250 2.0.0 Ok: queued as E634075E02CA
Connecting to 138.35.54.172:25...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.
220 smtpx.svcs.hpe.com ESMTP Postfix
500 5.5.2 Error: bad syntax
500 5.5.2 Error: bad syntax
ehlo 138.35.54.172
250-smtpx.svcs.hpe.com
250-PIPELINING
250-SIZE 31457280
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: xia@hpe.com
250 2.1.0 Ok
rcpt to: xia@hpe.com
250 2.1.5 Ok
data
502 5.5.2 Error: command not recognized
data
354 End data with <CR><LF>.<CR><LF>
Subject: Test mail
Hellow ord!!!
.
250 2.0.0 Ok: queued as E634075E02CA