Sending Mail

$ mail user@host.domain
Subject: HI

After you enter the subject, you can hit return, then type in the words and sentences of your message. You can use the following mail composing commands, also.

These are mail composing commands. Enter these starting in the first column of the line after you've entered the subject.
Command (starts in column 1)Purpose
. (period) end your mail message; if this doesn't work hold down the Control and D keys at the same time.
~p display the entire contents of your message
~r filename.txt read in the contents of the file named filename.txt into the mail message
~vi enter a vi editor session on the mail message so that you can edit it using vi; when you exit vi, you'll be back in mail program

Reading Mail

$ mail
Reading mail commands (enter these at the & prompt after starting up the mail program for reading mail)
? list all mail commands available; if this doesn't work, enter help
n (n is a number) display message number n
d delete the current message
x exit, but don't preserve any deletions
q exit, preserving any deletions
h list all mail messages and header information
s filename.txt save the current message into a file named filename.txt

For more Web-based instruction on Unix mail, see "UNIX Support--Generic Mail," from the Computer Help Desk, University of Victoria, Victoria, British Columbia, Canada.

Save this page to any social bookmarking site! Share · search Search · star Market
2020-04-25 · John December · Terms © December Communications, Inc.