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

Updated: 10/18/2022 by Computer Hope
Notification for new e-mail.

There are many ways a user can send and receive e-mail when connected through a telnet or SSH (Secure SHell) session. Below are some methods used on a telnet session or at the command line. However, realize that all the following solutions are only going to work if you have telnet or SSH access to your e-mail server or ISP (Internet Service Provider). 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].

Note

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

The links below 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 set up and installed on the 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 Enter. If you receive an error, it's likely not installed or configured on the server.
  2. From the main menu arrow, choose compose message or press C on the keyboard. 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 Enter. 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 L 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 Enter.

Any time you must get back to the main menu, press M or Q, and then Y for yes to quit from pine.

Send and read e-mail with elm

The elm command is another popular 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 M 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 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 J and K to navigate through the messages.
  3. Once you've selected the message you want to read, press Enter.
  4. In the message, if there are multiple pages press spacebar 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 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, a prompt appears 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 Enter 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 Enter. Otherwise, press Enter without typing anything.

Read an e-mail

  1. At the command prompt, type mail and press Enter.
  2. If available and you have any new e-mail messages, you'll 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.