uuencode - This is the original method to send encoded text within a message. It is not an attachment as we think of them today but is still used enough to warrant putting it here.
uuencode $ATTFILE $ATTFILE | mail -s "$SUBJECT" $MAILTO
simple shell commands - For a very simple text (plain or html) attachment with just one file:
echo "From: $LOGNAME\nTo: $MAILTO\nSubject: $SUBJECT\nMime-Version: 1.0\nContent-Type: text/plain\n" > /tmp/file
cat $TXTFILE >> /tmp/file
/usr/lib/sendmail -t -oi < /tmp/file
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.