Walker News

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 is your corporate Microsoft Exchange server):
  1. Execute telnet 25 to get telnet connect to ESMTP server at port 25 (SMTP listening port number).
  2. Enter helo to identify sending host (in this case, the Linux machine) to SMTP server. You will see “hello [IP-address]” replied from ESMTP.
  3. Now, type mail from:sender@walkernews.net to specify sender email address.
  4. Next, type rcpt to:recipient@exchangeserver.net to specify recipient email address.
  5. Type data to indicate start of email body/content.
  6. Now, type whatever you want as the email content. To signal end of email content, hit ENTER key then . and ENTER key again.
  7. Enter quit to quit from telnet-SMTP connection.

For more information, please check the list of SMTP commands, SMTP reply code, and ESMTP commands.

Custom Search

2017  •  Privacy Policy