Many thanks to all who answered my question on how to include a file as an
email attachment as well have it be the body of the same email.
Most responses suggested the following:
(cat report.txt; uuencode report.txt new_report.txt) | mailx -s "report"
boss
I like this one. It is simple and works.
Tom suggested the following (along with a one word commentary of
'Dah'....??)
cp report.txt report.tmp
echo "===== uuencoded attachment follows =====" >> report.tmp
uuencode report.txt new_report.txt >> report.tmp
mailx -s "report for you" big_boss < report.tmp
rm report.tmp
Although not as simple, it also worked well.
Also in line with keeping it simple, one suggestion from Stanley which
could probably be argued as being the best answer to the problem, although
not specifically to the question, was to just send the two separate emails,
one with the text in the body, and one with it as an attachment. This had
the advantage of decreasing the chances of very large messages being
dropped by an email system which couldn't handle very large messages. Kind
of a "belt and braces" approach as my English friends would say.
There were a couple other suggestions, but I didn't try them out. Again,
thanks to everyone who responded.
Patrick
Received on Fri Feb 19 1999 - 19:54:39 NZDT