TEACH EMAIL                                        Aaron Sloman Oct 1999

-- Introduction -------------------------------------------------------

There are many ways to send and read electronic mail nowadays, some
easier to use than others. This file introduces the Email mechanisms set
up for Poplog users here in Birmingham. Sending and reading email in VED
is not necessarily the easiest method, but it may be worth learning to
do because it will make things much easier when you are developing
programs and you want to ask your tutor or others for help. Using VED to
send or receive email will make it very easy to include bits of your
program file and program output, and to try out examples sent to you in
email messages.

Before reading on you should be fluent at editing text and marking
ranges in VED.

If you are unfamiliar with VED you can get a rapid introduction (suited
to the machines and software set up in the School of Computer Science
at the University of Birmingham) in the file TEACH * QUICKVED

This file used to be part of the TEACH * RHYME tutorial file. If you are
not already fluent in VED, read that file to gain practice in using VED
to manipulate text.

There is a table of contents at the end of this file. To look at it give
the command "ENTER g". You can also use that command to GO direct to any
section listed in the contents table.


-- Sending a message to yourself --------------------------------------

The following exercise in sending mail assumes you know how to mark
a range, as described in TEACH * MARK, or using the "ENTER menu mark"
menu facility.

You can send a poem to yourself as a message. E.g. the following, or
some other little poem you know:

    This is my first mail in Ved
    I hope it will quickly be read
    I hope you'll reply
    For, if not, I'll sigh
    Over fate I continue to dread.

Just above the poem (or the text you wish to send) write a line in the
form:

To: <username>

where you insert your login name, or your full email address, after the
colon. Make sure the "To" is AT THE LEFT HAND EDGE of the screen, i.e.
the beginning of the line.

Also make sure there is a space after the colon, before your user name.

Insert the "To: " line, with your username, then a blank line just
before the poem (or message text). Then mark the whole range from the
"To:" line to the end of the message. That indicates the message to be
sent, and to whom.

Make sure there is a blank line between the header line and your poem,
or it may take the words in the poem as names of people to send the
message to, because the poem is indented.

When you have marked the To: line and the whole poem (preceded by a
blank line), you can "send the marked range" by giving the following
command:

    ENTER sendmr

(A similar command is available via the "ENTER menu mail" menu options.
You can get the mail menu panel up by first giving the "ENTER menu"
command to bring up the "Toplevel" menu, if it is not already visible.
Then click on the "Mail..." button to get the Mail menu panel.)

Note : "sendmr" means "Send Marked Range".

Notice how VED adds an extra "header" line giving the name of the sender
and the date and time. That is the format used by Unix mail files: the
individual messages all start on a line beginning "From ....".

In a minute or two (or sometimes in a second or two) the mail you have
sent to yourself should arrive in your "mail box", a file held in the
system email directory containing your mail. Below you will find out how
to read the message and other mail waiting for you.

You can use the same technique to send the message to someone else whose
user name or email name you know. Try sending mail to another student or
friend who has an account on this system. You can use either their user
name (login name) or their full email name after the "To: ". Always make
sure you mark *only* the bit of the file that you want to send in the
message. You can easily send a whole file by mistake, including
embarrassing bits you'll wish had not been included.

-- -- Adding a subject line

When you get lots of messages and you wish to decide which to read first
it may be useful to be able quickly to tell the subject matter of
individual messages. To help recipients of your email do this you should
add a subject line to your messages.

It is very simple to modify the previous procedure to send a message
with a "Subject" line in VED. You can indicate the subject by typing a
line starting "Subject:" or "Re:" (the latter is quicker and will be
changed to "Subject:" automatically). E.g.

    Re: my first email message

Complete the To: and Re: lines below (leaving a space after the colon)
and then mark the range and use the "ENTER sendmr" command to Send the
Marked Range to yourself.

To:
Re:

Here is a lovely poem.
    Mary had a little lamb.
    Its fleece was white as snow.
    And everywhere that Mary went,
    The lamb was sure to go.

When you have completed the two header lines, mark all of that and then
use the "ENTER sendmr" command as previously to send the marked range.
(Or use the Sendmr button on the mail menu panel.)

-- Sending a message to your tutor ------------------------------------

You may need to send a message to your tutor. For that you need to know
his/her email name. For example the tutor for the introductory
undergraduate AI programming course is Riccardo Poli and his email name
is R.Poli (or r.poli since the mail system treats upper and lower case
as equivalent.)

Make sure you use the appropriate tutor's name. E.g. use "a.sloman" for
mail to Aaron Sloman, r.poli for email to Riccardo Poli, or j.l.wyatt
for Jeremy Wyatt. We have set things up so that you can find the email
name for a particular individual in VED by using the "ENTER aliases"
command. E.g. to see if there is an email name for someone called
"Pillinger" try the command "ENTER aliases pillinger". You will be shown
a short and a long email address for the person. You may find that there
are several people with the same surname. Make sure you choose the right
one.

Having found your tutor's email address you can send him/her a message,
copied to yourself, as follows.

To: <your tutors email name>
re: My very first message
cc: <your user name>

Dear

<type your message in here>

------------------------------
Put your own user name or email address after the "cc: ". Remember to
leave a space after the colon.

Insert the name of the person you are writing to after "Dear". (We use
first names around here.)

When you have finished typing in your message, mark the message, from
the To: line to the end.

Then, as before, give the command "ENTER sendmr" or use the Sendmr
button on the mail menu panel.

You need to be sure that you have marked a range, and only the range you
want to send.

If you just use "ENTER send" it may try to send the whole file, which is
not necessarily what you want!


-- Sending mail to several people -------------------------------------

You can use the same method to send mail to several different people.
You can do that by putting their names on the 'To: ' line separated
either by commas or by spaces. E.g.

To: I.Newton,J.R.Macwheedle,F.J.Bloggs

Don't confuse commas "," and dots ".".

NOTE: Previously you could use spaces instead of commas between the
email names. However, in October 1998 ved_send was changed to require
commas. This is to allow for more complex formatting of email addresses
with a combination of real name and email address, as in

    To: Fred Bloggs <f.bloggs@asite.univ.ac>

Since a space can separate the two parts of an email address, commas are
now required to separate complete addresses.

If the list is too long to fit on one line, you can start a new name
on the next line, provided that the line is indented by four or more
spaces, e.g.

To: A.Sloman,J.R.Macwheedle,F.J.Bloggs,
    J.Caesar,W.Shakespear,I.Newton

To email people, you can use either their login names, if you know them,
or their email names, which are usually longer and less likely to be
confused with other people's names. If you mistype a 3 letter login name
the chances are your message will go to someone whom you would not like
to read your message. So be very careful with short email names.

As explained above, if you want to send email to more names than you can
fit on one line, start a second line of names indented by four or more
spaces. It is essential to have that indentation, otherwise the next
line will be taken as part of the message. Do not leave any blank lines
in the "header". The "send" program will take a blank line to mean that
the message header as ended and the message body is starting.

You can leave a blank line just before you get to the start of the
"message body".

If the message body is indented then you MUST leave a blank line. So you
might as well train yourself to leave a blank line always.

You can also put multiple names on the "Cc: " list, so that the message
is "copied" to several people. It is sometimes useful to make clear that
the message is sent to some people, and copied to others who may need to
know that you have sent the message, or who may wish to see any reply
that you get.

-- -- Some useful email lists

There are several email lists to which you can send messages. For
example your own course will have an email list, which you can find out
from your tutor. You can send mail to all students on your course by
using that list. E.g. if your email list is called "XYAI93" you can use

To: xyai93

to send mail. (That is not a real email list name).

There is a general email list for advice and help on unix and X. It is
called "advice". So you can ask for help about Unix, X, C programming,
etc. by sending email to "advice".

There is also a list for users of Poplog. You can send questions about
Pop-11, VED, Prolog to "poplog-users".

You can add yourself to the poplog-users list by sending a message to
the "majordomo" mail list manager program, containing just one line
"subscribe poplog-users". To do that mark the next three lines, then
use ENTER sendmr

to: majordomo

subscribe poplog-users

You will then get copies of all messages to that list, which you may
find useful. Later you may wish to delete yourself from that list, using
the message

to: majordomo

unsubscribe poplog-users

There are other email lists. The file TEACH * EMAIL.ETIQUETTE
gives you some warnings about abuses of the email system. E.g. do not
send long junk messages or jokes etc. to email lists, and do not
attempt to use our email or net news system for any sort of
commercial activity, no matter how badly you need the money.

Also read the conditions for use of university computing facilities.

Abuses of our email system will be SEVERELY punished. Remember that our
computing resources are paid for out of scarce funds to support teaching
and research only.

Unfortunately, nearly every year there are one or two immature people
(usually young males) who ignore these warnings, and then get detected
and punished.

-- -- Format of email addresses

You can send email both to people using the same machines or the same
local network as yourself (people in the same "mail domain"), or to
people in other places. For the former you can just use the local names
known to your mail system.

For sending mail to people in other places you have to use a more
complex form of email address that includes the local name by which they
are known at their own site and then the "@" symbol pronounced "at" and
then a name for that site. Thus for someone using a sub-domain called
"robots", in the department of AI at Edinburgh University, in the
academic sector of the UK the name for the site might take a form
something like this (which is not a real example):

    @robots.ai.ed.ac.uk

If a person were called "j.caesar" in that department, then his (or her)
complete address would be as follows

    j.caesar@robots.ai.ed.ac.uk

-- -- Using a .mailrc file for email aliases

Remembering long email addresses can be very tiresome, so it is possible
to define your own abbreviations in a file of your own called ".mailrc".

How this is done is described in HELP * SEND/Aliases.

It is best to start by copying someone else's .mailrc file and editing.
Or you may have been given a default .mailrc file when your account was
set up. You can then edit that to add new aliases.

It is also common for the local site to have email aliases for groups of
people. E.g. there may be an alias called "advice" which can be used to
send messages to people who are willing to answer technical questions
about Unix and programming issues. There may be an email alias for
"clerical-staff", for "teaching-staff", etc. Conventions about this
vary. In VED (at Birmingham) you can find out about the local system
aliases by using the "ENTER aliases". E.g. Try

    ENTER aliases advice
    ENTER aliases latex-users
    ENTER aliases linux-users
    ENTER aliases <your surname>

If you wish to have an alias that you use as a shorthand for sending
mail to several people you can put into your .mailrc file something like
this:

alias my_friends  j.caesar g.khan n.bonaparte a.hitler j.stalin

Note: separate the names with spaces, not commas.

Then sending mail to my_friends will cause it to go to the named
individuals. (VED's "send" and "sendmr" commands can handle this. Not
all mail systems can cope with user-defined aliases.)

-- Giving Unix commands from VED --------------------------------------

It is often convenient to give a Unix command from VED and have the
output read into a temporary VED file, so that you can browse the
output, copy it to another file, send it in an email message, or
whatever.

For example you can see who is logged in on the machine you are using,
without leaving VED by giving the command

    ENTER unix who

or you can look at a full list of files in the current directory by
doing

    ENTER unix ls

If you want them arranged in columns do

    ENTER unix ls -C

Or find out if one of the secretaries is logged in, e.g.

    ENTER unix finger heathcote

-- -- Checking whether you have mail waiting in your mail box

You can use the unix "from" command to find out if you have any email
waiting to be read, as follows:

    ENTER unix from

With luck, a message you sent yourself previously will have arrived by
now. Perhaps you will even have had a message from an admirer?

-- Reading mail: ENTER getmail ----------------------------------------

If there is email for you it will be waiting at first in a file with
your login name, in the Unix "incoming mail" directory which is part of
our system. It is not automatically made part of your directory.

Like the "from" command mentioned above, mail reading programs know how
to find that file and make its contents accessible to you. One of those
programs is the ved_getmail procedure which you can use to read mail in
VED.

Try the following command:

    ENTER getmail

If there is no new mail for you, this will tell you.

Otherwise it does the following:

1. If there is mail for you it will be moved from the system directory
into a directory of your own (usually your directory called Mail, which
is protected from being read by other users).

The VED getmail procedure will give the new mail file a new name
composed of "mail" and a number, e.g. "mail33" if this is 33rd mail file
you have read, and it will read that whole file, with all its messages,
into VED for you to examine.

2. It checks whether you have set the variable vedmailmax to have a
number bigger than 0, and if so it uses that number as a guide to
whether to merge your new mail file with the previous one. If that would
make the combined file too large, it will not merge the files. Otherwise
it will merge the files. So the mail33 file can be removed and the
contents put at the end of the mail32 fail. This prevents you collecting
lots of small mail files, which some people find confusing.

3. The new file is read into VED and if two files were merged a line is
inserted showing where the new mail starts and the date and time it was
read in. The line may look like this

%%%%%%%%%%%% NEW MAIL Tue Jun 30 18:25:58 BST 1998 (@@@  MAIL FILES MERGED  @@@)

4. It then creates an index file, showing you which messages there are
in the current mail file, who they are from, who the addressees are, and
the subject of the message. The next section explains how to use this
message index file.

-- -- The message index file

The index file will usually have about three lines for each message,
something like this.

1: 1 From shirlyp@fest.edinburgh.ac.uk Tue Sep 27 11:46:18 1994
To: A.Sloman
Subject: Request for comments
2: 35 From Aaron Sloman Tue Sep 27 12:16:30 BST 1994
To: a.j.p.taylor
Subject: History lessons
3: 50 From teaching-request@cs.bham.ac.uk Tue Sep 27 12:13:38 1994
From: A.Sloman
To: T.H.Axford
4: 139 From S.M.Pillinger@cs.bham.ac.uk Tue Sep 27 12:27:06 1994
To: A.Sloman@cs.bham.ac.uk
Subject: Re: cs-staff email list

If you wish to go to a particular message you can use this index
by putting the VED cursor on the message number (one of the lines
containing "From") and then giving the "ENTER gm" command (GoMessage).
This is described in more detail in the HELP * VED_MDIR file. You can
also use the GoMessage button in the mail menu panel.

If you wish to ignore the message index file, just quit the index file
by doing "ENTER q", or using the accelerated key sequence ESC q.

You can always create a message index file for the current mail file by
using the command "ENTER mdir".


-- Browsing the mail file ---------------------------------------------

When you get back to your message file you will find that each message
starts with a line beginning "From ". Then there are other lines that
start with various words followed by a colon, e.g. "Date:" "To:",
"Received:", "From:", "Cc:". All those lines constitute the "header" of
the message.

The header lines contain information about who sent the message, where
it was sent, when it was sent, which intermediate machines it went
through before it got to you, and other things. After the message header
there should be a blank line and then the message body, which you can
read as you would read any other VED file, using the SCREENDOWN and
other keys (or menu buttons).

-- -- Tidy Mail Headers

If you wish to keep the message, but don't want lots of unnecessary junk
in the mail header you can use a VED command to tidy the header by
removing information that is not likely to be useful. Just do

    ENTER tmh

to Tidy the Mail Header for that message. There is also a TidyMess
button on the mail menu panel.

If you wish to tidy ALL the mail headers in the file give the Tidy All
Headers command

    ENTER tah

(Occasionally that will get rid of useful information about how the
message arrived, but mostly you won't need the stuff that is removed.)

-- -- Deleting a message

If you no longer wish to keep a message that you have read, you can
delete it with the "Clear Current Message" command

    ENTER ccm

To try that command out here is a dummy message

From Aaron Sloman Wed Sep 28 01:03:45 BST 1994
To: the_reader
Date: Wed Sep 28 01:03:58 BST 1994
Subject: Testing ved_ccm

Put the VED cursor on THIS line and then, when you are feeling really
brave, give the command

    ENTER ccm

and see what happens.
====END OF MESSAGE====

From Your favourite tutor
To: Anyone@interested
Re: A dummy mail header
From here the stuff should not be deleted, because the line above line
starts "From" and therefore looks like another mail message.

-- Restoring a message cleared by accident ----------------------------

If you realise just after deleting a message that you deleted the wrong
one you can put it back as follows. Make sure your VED cursor is not in
the middle of a message, e.g. it could be at the end of the file, or
just before the "From" line starting a message. Then you can "Yank" back
the message you just deleted, so that it is re-inserted just after the
line containing the VED cursor, by giving the command

    ENTER y

Try re-inserting the message you just deleted, before this line.

You can only re-insert the last thing deleted. If you deleted two
messages separately, the first one is lost. Later you can learn how to
get back the contents of a "backup" file, which may have the information
that you just deleted, depending on when the backup was created.

-- Marking a message --------------------------------------------------

There are lots of things you can do with a message besides deleting it.
You can reply to it, you can move it to another file, you can send it to
someone else, or you can make a copy of it to save forever and ever.

Most of these facilities depend on the fact that VED can automatically
"mark" a message, and will then be able to use general facilities for
operating on the marked range. You mark a message by putting the VED
cursor somewhere in the message (on or after the "From" line) and then
giving the Mark Current Message command, mcm. Try the following:

From Aaron Sloman Wed Sep 28 01:03:45 BST 1994
To: The_Reader
Date: Wed Sep 28 01:03:58 BST 1994
Subject: Testing ved_mcm

Put the VED cursor on this line and then give the command

    ENTER mcm

and see what happens.

It should mark up to this line and the next blank line.


From Aaron Sloman Wed Sep 29 01:03:45 BST 1994
To: Another reader
Date: Wed Sep 28 01:03:58 BST 1994
Subject: Dummy header

It will not mark this bit because the mail header starting with "From"
is recognized, therefore taken to be the beginning of another message!
(Yes that is a stupid feature of the Unix mail conventions.)

-- Reporting faulty machines ------------------------------------------

There is an email address that you can use if there is a computer that
appears not to be working, or if you have accidentally deleted all your
files and you would like them to be restored from the backup tapes. It
is "support", or "support@cs.bham.ac.uk"

Do not use that email address to ask for help with programming problems,
your PC at home or anything else specific to your use of the computers.

There is an email address "advice" to which you can post general
questions about "how to do ....". This list contains staff and students
who have volunteered to share their expertise.

There are several more specialised email aliases including poplog-users
described above, linux-users, java-users, and many more. Some of them
are "open" email lists, which means you can join them by sending a
message to majordomo, as described above. E.g. to join linux-users do
use this:

To: majordomo

subscribe linux-users

-- Replying to a message ----------------------------------------------

You can ask VED to prepare a reply to a message by putting the
cursor in the message and then typing one of these commands.
    ENTER reply
    ENTER Reply

The second one will cause VED to start a reply addressed not only to the
original sender but also to all recipients of the message. The first one
prepares a reply only to the sender.

If you wish to include the original message indented so that you can
comment on bits of it, then you can use one of these commands to prepare
your reply
    ENTER respond
    ENTER Respond

The first will prepare a reply only to the sender. The second will
prepare a reply addressed to the sender and everyone else who received
the original message.

Here is an example, a dummy message to two people with a Cc: list
specifying that copies were sent to three other people.


From Aaron Sloman Wed Sep 28 01:14:23 BST 1994
To: A.Target,B.Target
From: Aaron Sloman <A.Sloman@cs.bham.ac.uk>
Date: Wed Sep 28 01:03:58 BST 1994
Subject: Testing ved_reply and ved_Reply
Cc: A.Recipient,B.Recipient,C.Recipient@css.bham.ac.uk

Here is a dummy message for which you can prepare a dummy reply.
Put the cursor here, and then do

    ENTER reply

(later on try ENTER Reply then ENTER respond)

You will see that VED will prepare a message header for your reply, and
you can then type your reply and send it off using the ENTER sendmr
command as described above.

From this line VED will think the original message had ended, and so the
reply will be prepared just before this line, immediately after the
original message.

Now delete that example reply (but not the original dummy message) and
try again using the second format to prepare a reply to go to EVERYONE.
I.e. put the cursor back in that message above, and then do
    ENTER Reply

with a capital "R". It should now produce a more complicated message
header, something like this

From ... your ... name...
From Aaron Sloman
To: A.Sloman
Subject: Re: Testing ved_reply and ved_Reply
Cc: A.Recipient,B.Recipient,C.Recipient@css.bham.ac.uk,A.Target,B.Target

Notice that this header has a Cc: line which specifies people who should
get copies of the message. You can also type a Cc: line yourself into a
message header before sending the message if you want some people to get
copies. However THERE MUST NOT BE A BLANK LINE before the Cc: line as it
will then be taken to be part of the message body, not the header.

If you try ENTER respond, and ENTER Respond, you will see how to prepare
a reply that includes the original message, which is often useful to
provide a context for your reply. Usually it is not a good idea to send
the whole of the original message. Delete the irrelevant bits and add
your comments to the relevant bits, for more on this see:
    HELP * VED_GETMAIL/respond

There are many more things you can do with mail inside VED. Further
information is provided in the online documentation files listed below.

-- Further reading ----------------------------------------------------

For more information on VED see

TEACH * VED
TEACH * MOREVED
TEACH * MARK
HELP  * LMR

For more information on reading mail see
HELP * VED_GETMAIL
HELP * VED_MDIR

For more information on sending mail see
HELP * SEND
HELP * VED_REPLY

For more information on replying and responding to mail see
HELP * VED_GETMAIL/reply

For more information on Unix commands see
HELP * SHELL
HELP * UNIX.COMMANDS

For information on printing from VED see the following

HELP * VED_PSPRINT
For printing simple text files to a laser printer that uses postscript.

TEACH * PRINTING
Gives more information about printing options available.


=======================================================================
         CONTENTS - (Use <ENTER> g to access required sections)

 -- Introduction
 -- Sending a message to yourself
 -- -- Adding a subject line
 -- Sending a message to your tutor
 -- Sending mail to several people
 -- -- Some useful email lists
 -- -- Format of email addresses
 -- -- Using a .mailrc file for email aliases
 -- Giving Unix commands from VED
 -- -- Checking whether you have mail waiting in your mail box
 -- Reading mail: ENTER getmail
 -- -- The message index file
 -- Browsing the mail file
 -- -- Tidy Mail Headers
 -- -- Deleting a message
 -- Restoring a message cleared by accident
 -- Marking a message
 -- Reporting faulty machines
 -- Replying to a message
 -- Further reading

--- $poplocal/local/teach/email
--- Copyright University of Birmingham 1999. All rights reserved. ------
