[KLUG Members] email attachments from the command line

Gettig,Tony members@kalamazoolinux.org
Wed, 19 Jun 2002 12:06:45 -0500


Hey there,

Never had to really do this until today. I need to attach a
 file from the command line, like in a nightly cron job. 

For text files, no prob. "mail recipient < filename" seems
 to work just fine. Also "command | mail recipient" seems
 to work good.

I'm having a trouble with other attachments though. Like a
 spreadsheet, PDF, bitmap, or other non-text file. I've
 experimented with metasend, but the file attachments keep
 showing up as multipart base64 encoded. Nay, I want just
 one email with one attachment, like the silly users are
accustomed to receiving in most email clients. Is there an
 easy way to achieve this? The command I'm using is:

metasend -b -t recipient -s "Here is my file!" -m
application/octet-stream -f filename

When I do this, I get several emails with the base64
 encoded gibberish in the body of the message. I've read
 the man page and tried the different encoding options, but
 I still get multiple emails that can't be decoded by the
 client.

Any pointers in the right direction are appreciated. TIA!

Tony Gettig