[ILUG] sending a file via email with a script

Kenn Humborg kenn at linux.ie
Sat Sep 2 12:21:48 IST 2000


On Sat, Sep 02, 2000 at 07:25:29AM +0100, Conor Daly wrote:
> On Thu, Aug 31, 2000 at 12:57:05PM +0100 or so it is rumoured hereabouts, 
> Jeremy Smyth thought:
> > 2 - mutt -a attach.file -s "Subject" recipient at domain.com < /dev/null
> > or replace /dev/null with a file containing the body text of the mail
> > </reply>
> 
> Of course, i didn't have mutt available on the machine in question so I
> was stuck with using mail.  I found mimencode didn't work in any easy
> fashion so I ended up using uuencode.  It went something like this:
> 
> uuencode <File to attach> <Name of file in email message> | mail -s <subject> <recipient at domain>

Look at metasend.  It does exactly what you want.  You specify attachments
like:

$ metasend -f some-file -e <encoding-scheme> -m <mime-type> -D "description" \
        -n -f other-file -e <encoding-scheme> -m <mime-type> -D "description" \
        ...

For example:

$ metasend -f file.txt -e quoted-printable -m text/plain -D "this is file.txt" \
        -n -f word.doc -e base64 -m application/msword -D "a Word document"
       
Later,
Kenn






More information about the ILUG mailing list