How to send a attachment

Hi,

I want to send a attachment using mailx command and also i want to include body of the mail which is stored in a text file.:confused:

uuencode att.txt att.txt |mailx -s "attachment" adc@mail.com < text.txt

I tried this command, but it is not working fine. It is showing the body but it is not sending the attachment. Please help

Thanks,
Lathish

I found that with mailx, I could either make an attachment OR pass a message. But, I could not do both. Because of the nature of my specifics, I often had more than one attachment. Thus, I created a loop to send all my attachment messages one-at-a-time, and then send a summary email.

uuencode att.txt att.txt |mailx -s "attachment" adc@mail.com 
mailx -s "attachment summary" adc@mail.com < text.txt

I have been told that there are other mail utilities available for unix that can accomodate the attachment and message. Perhaps someone here can add the name(s) of other utilities. [Or, let us know how to get the syntax to work.]

Thanks joeyg for your solution.

But i found how to send the summary report and attachment in a single mail command,

(cat text.txt uuencode att.txt att.txt) |mailx -s "attachment" adc@mail.com
mailx -s "attachment summary" adc@mail.com

Hope this wlll help you.