Problem while sending message and attachment with mailx

Hi All,

I am trying to send a mail with an attachment and message. Following command I am using.

(cat <messagefile> ; uuencode <attachmentfile> <attachmentfile>)|mailx -s"Subject" dave@email.com

In the received mail, message body is appearing fine. But attachment is not coming. Rather content of attachment is appearing in the body of the mail in encoded format.

Please advise.

Thanks
Nihar

It is very close to being correct.

I would try:

( echo `cat <messagefile>` ; uuencode <attachmentfile> <attachmentfile>)|mailx -s"Subject" dave@email.com

Wow....it works.

Thanks a lot.