How To Send Email Using Telnet Client?

As you probably know, email administrator cans telnet to SMTP server at port 25 for sending email, a trick which is commonly used to verify or troubleshoot SMTP configuration.
In the following example, I use the legacy telnet client on RHEL5 (Linux) to connect ESMTP (Extended SMTP or Enhanced SMTP) served by Microsoft Exchange server, for sending a test email, to confirm Exchange server allows Sendmail on this Linux machine to relay emails.
Note, there is no need to enable Sendmail service or configure smart-host of Sendmail, if you simply want to play fun or experience how to use telnet to connect SMTP for sending email.
So, here you go – using telnet to send email at Linux command prompt (assuming this IP address 192.168.15.33 is your corporate Microsoft Exchange server):
- Execute
telnet 192.168.15.33 25to get telnet connect to ESMTP server at port 25 (SMTP listening port number).
- Enter
heloto identify sending host (in this case, the Linux machine) to SMTP server. You will see “hello [IP-address]” replied from ESMTP.
- Now, type
mail from:sender@walkernews.netto specify sender email address.
- Next, type
rcpt to:recipient@exchangeserver.netto specify recipient email address.
- Type
datato indicate start of email body/content.
- Now, type whatever you want as the email content. To signal end of email content, hit ENTER key then
.and ENTER key again.
- Enter
quitto quit from telnet-SMTP connection.
For more information, please check the list of SMTP commands, SMTP reply code, and ESMTP commands.


Custom Search






2012 •