HELP VED_ATTACH                                    Aaron Sloman Feb 2001

LIB ved_attach

Revised 11 Feb 2003
    To allow multiple files to be attached


Use of these facilities requires

    uses vedmail
    (E.g. in your $poplib/vedinit.p file)



The command:

    ENTER attach <filename>

    Reads into the current Ved file a message template including an
    attachment containing a mime-encoded version of the file specified.

    Then all you have to do is edit To: and Subject: lines (and edit or
    delete Cc: and Bcc: lines) add your comments in the message field,
    then send the whole file using
        ENTER sendmr

    ENTER attach <filename>  <filename> ....
    This will attach several files. Warning: the names of the files are
    truncated to be just the file names without path information. So if
    two files in different directories have different names either
    rename them before attaching or edit the names inserted by
    ved_attach before sending.

(Please note the warning about old and new versions of LIB ved_send,
below, if you are not using this at Birmingham).


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

 -- Overview
 -- Multiple attachments
 -- Sending the message
 -- -- Old and new versions of ved_send/ved_sendmr
 -- -- Leave no blank lines in the header
 -- An example
 -- REQUIREMENTS
 -- Fetching the new ved_send
 -- Decoding attachments
 -- Changing the program

-- Overview -----------------------------------------------------------

ENTER attach <filename>

This command reads in a mime-encoded version of the file, and prepares
lines to go into message header and attachment header to allow
the attachment to be sent and decoded at the other end.

It also prints instructions. The first time it is used in any Ved
session it prints lengthy instructions into the file (as shown in the
example below).

Thereafter it prints only a short reminder. To get the lengthy
instructions again either do

    ENTER lib ved_attach

or leave and restart Ved.

For those unaccustomed to Ved: the Ved command above

    ENTER attach <filename>

Is given as follows:
    Press ENTER key (or CTRL-g)
    Type the command line as shown: attach...
        including the name of the file to be attached
    Press RETURN key (not ENTER).

It will prepare a mail message for you, with the range marked, and
portions for you to edit, before sending, as explained below.

-- Multiple attachments -----------------------------------------------

It also handles multiple attachments. So you no longer have to send each
attachment in a separate message.

(For recipients it is sometimes more convenient to put multiple files in
a gzipped tar file or zip file and send as one attachment.)

-- Sending the message ------------------------------------------------

Having edited the To:, Subject: and other lines in the message
header you can also edit an introductory text field which the
ENTER attach command will set up (example below).

Then make sure everying is marked (See TEACH mark, HELP mark), and post
the marked range using

    ENTER sendmr

-- -- Old and new versions of ved_send/ved_sendmr

If you use the new version of lib ved_send from Birmingham (see below)
it will send the full header as marked in the file.

However, if you use the default older lib ved_send/ved_sendmr supplied
with poplog it will not necessarily work properly. That version pipes
email through mail or Mail. It will send the message, but not as a
mime-compliant message, and the recipient may or may not be able to use
the file.

(Later the poplog system will be re-packaged with the new version as the
default.)

The new send/sendmr command allows address lists on the To: line
and Cc: and Bcc: lines to overflow, so that you can continue with extra
address lines, provided that they are indented by four spaces or a tab.

The old version packaged with Poplog does not support this.

For the new version all addresses must be separated by commas, not just
spaces, as it understands address formats like this, which can include
spaces:
    Mrs Freddie Bloggs <f.blogs@psych.greatuniv.edu>,
    "Mr Joe Bloggs" <fred.blogs@phil.greatuniv.edu>

It is simplest to put one such address on each line, indented by a tab.
Commas will automatically be inserted at the end of each address line if
needed.

-- -- Leave no blank lines in the header

Do NOT allow any blank lines to occur before the end of the header.
So if you don't want a Cc: list or a Bcc: list delete those lines
completely, don't just leave them blank.

-- An example ---------------------------------------------------------

Example: The command
    ENTER attach ved_attach

Was used to produce a mime-encoded attachment from an early version of
this file before the attachment was inserted. (It will also work with
non-text files, e.g. tar.gz files, doc files, binaries, etc.)

The result is the text between the two rows of "=" signs.

=======================================================================

EDIT THE MARKED RANGE, THEN ENSURE IT IS STILL ALL MARKED AND SEND WITH
         ENTER sendmr
NOTES:
   The To: and Cc:/Bcc: lines can overflow.
       Overflow address lines must start with at least four spaces or a tab.
   NB: Use comma to separate addresses.
   NB: Leave a space after each colon.
            Delete unwanted lines in the header: do NOT leave them blank.
   See HELP ved_attach, TEACH email, HELP ved_getmail, HELP send

To:
Subject:
Cc:
Bcc: <addresses for "blind copies">
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="BARRIER-INSERTED-BY-ved_attach===64x5986"

This is a multi-part message in MIME format,
with an attachment below.

--BARRIER-INSERTED-BY-ved_attach===64x5986
Content-Type: text/plain; charset=us-ascii; format="flowed"

INSERT YOUR PLAIN TEXT MESSAGE HERE



Content below inserted by ved_attach

--BARRIER-INSERTED-BY-ved_attach===64x5986
Content-Type: text/plain name="ved_attach"
Content-Disposition: attachment; filename="ved_attach"
Content-Transfer-Encoding: BASE64

[encoded data, 9490 characters]
bCByaWdodHMgcmVzZXJ2ZWQuIC0tLS0tLQo=
--BARRIER-INSERTED-BY-ved_attach===64x5986--

=======================================================================

Note, when the above text is inserted, the whole insert from the
To: line at the start to the final barrier line is marked automatically.
(See HELP mark).


-- REQUIREMENTS -------------------------------------------------------

LIB ved_attach REQUIRES

    LIB mimencode
        http://www.cs.bham.ac.uk/research/poplog/auto/mimencode.p

    LIB ved_readmime
        http://www.cs.bham.ac.uk/research/poplog/auto/ved_readmime.p

These and related files can be fetched from

    http://www.cs.bham.ac.uk/research/poplog/attach

Also packaged in

    http://www.cs.bham.ac.uk/research/poplog/attach.tar.gz

-- Fetching the new ved_send ------------------------------------------

The new LIB ved_send and the related LIB ved_getmail, ved_reply,
ved_respond, etc. can be fetched in this file

    http://www.cs.bham.ac.uk/research/poplog/vedmail.tar.gz
or
    ftp://ftp.cs.bham.ac.uk/pub/dist/poplog/vedmail.tar.gz

(About 86 Kbytes).

-- Decoding attachments -----------------------------------------------

A related package (still under development) is ved_decode, which
allows mime attachments to be extracted and decoded easily while you
are reading mail in Ved.

See

    HELP ved_decode
        http://www.cs.bham.ac.uk/research/poplog/help/ved_decode

    LIB ved_decode
        http://www.cs.bham.ac.uk/research/poplog/auto/ved_decode.p

Later that will also be packaged with

-- Changing the program -----------------------------------------------

Like several packages at the Free Poplog site

    http://www.cs.bham.ac.uk/research/poplog/freepoplog.html

this library is still under development. Anyone using it may edit
it to suit local requirements, e.g. remove the bit of the
ved_attach that prints out out verbose instructions, or change them
to suit local users.

Please post comments and suggestions to comp.lang.pop, or to

    A.Sloman AT cs.bham.ac.uk


--- $poplocal/local/help/ved_attach
--- Copyright University of Birmingham 2005. All rights reserved. ------
