Sending a File by Mail
If you have a file called apple.txt and you want to mail its contents to to nobody@foo.com with the subject line "unix-asg1," you can do this using the Unix mail program like this:$ mail nobody@foo.com Subject: unix-asg1 ~r apple.txt . Cc: $
Note that the ~r apple.txt starts in column 1. Also the period (.) to end the mail message is in column 1.
Note that some Unix mail programs may ask you for the "Cc:" right after entering the Subject line. Some mail programs may require you to hold down the Control key and the D key at the same time to end the mail message rather than a period in column 1.
Check out this mail reference for more mail commands.