I use mpack at a bash command line for this purpose. To the best of my knowledge it will only permit the attachment of one file at a time. Although munpack will parse out multiple attachments from a single email.
But the advice above seems sound. You essentailly want to _pack_ your binary data using MIME encoding which converts everything into network safe ascii, to be decoded on the other end.