How to read and send e-mail in a telnet or SSH session

Updated: 01/24/2018 by Computer Hope

EmailThere are numerous different ways a user can send and receive e-mail when connected through a telnet or SSH session. Below are a few of the most commonly used methods used on a telnet session or at the command line. However, keep in mind that all of the following solutions are only going to work if you have telnet or SSH access to your e-mail server or ISP. Finally, when sending an e-mail using any of the below methods, you'll be sending an e-mail from the account. For example, if your account name was test and you were sending e-mail from the Computer Hope server, the e-mails would be coming from [email protected]

Notice: Telnet sends all data as cleartext, which means the information you enter during session is not encrypted and can be read by a user sniffing or eavesdropping on your connection. Any user who is concerned about their privacy should use SSH instead of telnet.

Below is a quick link to each of the sections on this document that explain how to send mail through each of the widely used and available programs.

Send and read e-mail with pine

One of the most easiest and most common ways to send and receive e-mail is to run the pine command. If pine is setup and installed on your computer you're connected to, you can send and receive e-mail through its interface. Below is additional information about how this can be done.

Send an e-mail

  1. Open PINE by typing "pine" at the command line and press the "Enter" key. If you receive an error, it's likely not installed or configured on the server.
  2. From the main menu arrow, choose the "COMPOSE MESSAGE" option or press the "C" key. From the compose message section, you can address the message to the user(s) you want to send the e-mail to, the subject, and the message.

Read an e-mail

  1. Open PINE by typing "pine" at the command line and press the "Enter" key. If you receive an error, it's likely not installed or configured on the server.
  2. Once in PINE, use the arrow keys to select "FOLDER LIST." Or, press the "L" key to either open you directly to the INBOX or allow you to specify the mail folder and the folder you want to display.
  3. Once in the INBOX, move to the message you want to read and press the "Enter" key.

At any time you need to get back to the main menu, press the "M" key or press the "Q" key and then "Y" for yes to quit from PINE.

Send and read e-mail with the elm

Although not as user friendly for most users, the elm command is another popular and widely used method for sending and reading e-mail through an SSH or Telnet session or at the command prompt. Below is additional information about how to use this command to send and receive e-mails.

Send an e-mail

  1. Open ELM by typing "elm" at the command line. If you receive an error, it's likely not installed or configured on the server.
  2. Press the "m" key to mail a message, type the address, subject, and message you want to send.
  3. Once done typing the message, press Ctrl+X (^X) to exit the message.
  4. Press "y" for yes if you want to send the message, and the message should be sent.

Read an e-mail

  1. Open ELM by typing "elm" at the command line. If you receive an error, it's likely not installed or configured on the server.
  2. If e-mail messages are available to be read, they are shown on the first screen; you can either press the arrow up or down or the "j" and "k" keys to navigate through the messages.
  3. Once you've selected the message you want to read, press the "Enter" key.
  4. In the message if there are multiple pages press the spacebar key to page through the message. If you continue to press space, it also goes through each of the messages.

Send and read e-mail with the mail

The mail command is a basic mail program that allows a user to read and send e-mail from the command prompt. Below is additional information about how to use this command to send and receive e-mails.

Send an e-mail

  1. At the command line, type "mail [email protected]" where [email protected] is the e-mail address you want to e-mail.
  2. If executed properly and available, you should be prompted with the subject of the message. Type a subject and press the "Enter" key.
  3. Next, you'll start off on a new line; this new blank line is the message body of your message. Type your e-mail message you want to send and when completed type a period "." on a blank line and press the "Enter" key to finish the message.
  4. Finally, you'll be prompted for a Cc. If you have any other addresses you want to send the e-mail to, type those addresses on this line and press the "Enter" key; otherwise, just press the "Enter" key.

Read an e-mail

  1. At the command prompt type "mail" and press the "Enter" key.
  2. If available and you have any new e-mail messages, you should see a listing of e-mails with corresponding numbers next to each of them.
  3. Type the number for the e-mail you want to read.

Additional information