Look at metamail. metasend is the command line program to actually
send the
file as an attachment.
Here is the important line in my script to do it.
${METASEND} -b -s "${SUBJECT}" -S 1000000 -f ${TEMPFILE} -m
application/binary\; name=\"${FILENAME}\" -D ${FILENAME} -t ${MAILTO}
-c
-------------------------------------------------------------------------------