All of the below examples use the following shell variables. I use MIME type application/octet-stream just as an example. Actual type used will vary depending upon attachment file type. Remember, these are simple examples of the different tools available.
TXTFILE=/tmp/textfile # A text message with a simple preface message ATTFILE=/tmp/binary_file # File to be attached and generally requiring encoding SUBJECT="Your attachment" # Change as needed MAILTO=user@where.ever # Ditto
uuencode $ATTFILE $ATTFILE | mail -s "$SUBJECT" $MAILTO (uuencode $FILE1 $FILE1; uuencode $FILE2 $FILE2) | mail -s "$SUBJECT" $MAILTO
echo "From: $LOGNAME\nTo: $MAILTO\nSubject: $SUBJECT\n\ Mime-Version: 1.0\nContent-Type: text/plain\n" > /tmp/file cat $TXTFILE >> /tmp/file