Every now and then I need to send by email some file to a friend or coworker or even myself. I have found that the easiest way to do this is just having a shell script that do the hard work for you.
After some research I found a set of scripts that actually do what I want (credit goes to Heiner Steven). The bad news is that this is not a full-bash solution. The scripts use the metasend command to send files as MIME atachments.
This is a easy two-step process. First, you need to install the metamail (this is the name of the Debian GNU/Linux package) in your box. Then grab this two scripts (sendfile, getmimetype). The first one does the call to metasend. From it’s usage information:
usage: sendfile [-f] [-s subject] [-m mimetype] recipient file ...
-f: force sending of mail even for invalid recipients
-s: subject of the mail message
-m: mime-type (i.e. "application/octet-stream")
Multiple files may be specified. If no mimetype was given,
it is determined via a call to "getmimetype".And you are ready to go.
Popularity: 17% [?]
Leave a reply