sending attachments via unix

Hi,
I need to send a mail attachment from the UNIX commandline. I'm using Tru64 and the mail client thats supposed receive the attached file (an excel sheet) is Lotus Notes.
Can anybody help me out?

I have used the following command line to send an Excel Spreadsheet as an attachment.

(cat /tmp/message.body; uuencode /tmp/VALSP.xls VALSP.xls)| mailx -s "Company Service Orders import file" user@xyz.com

The command assumes that the message body is in the file /tmp/message.body' and the xls file is in /tmp/VALSP.xls

Thanx a lot...works just fine!

I am noticing sthing funny now----whenever I send an XL file as an attachment, when I open my inbox, I am unable to see the "paper clip" icon that tells you that the mail contains an attachment. But try the same with a JPG file, and I can see the icon.
Am I missing sthing in the MIME? Then why is it tht i see the discrepancy in the 2 cases?What could be leading to this?

You weren't sending the message using MIME. The format is very different and the encoding is Base64 not UUENCODE.

Your mail client doesn't even have to interpret this as an attachment since uuencoded messages are just text anyway. The mail client has to guess at the file's format when it determines that a uuencoded message text is found. MIME is also converted to text but doesn't have to guess what the file format is since it's specified in the MIME header. You can define your own MIME message segments but they are simply painful. I needed to do this many years ago when email clients were less sofisticated but now it's really not necessary.

You can get a basic idea of MIME's complex structure here.

uuencode [dir/filename] [filename] | mailx -s [subject] mail@address.com

try this it will work !!

That was already suggested and the OP acknowledged that it did work. The OP's question was why was his mail client showing the paperclip icon for one type of attachment uuencoded vs another.