email attachment, with a message using mailx

Hi, I am trying to include a message along with an attachment with an email using mailx on AIX.

uuencode Test.dat Test.dat| mailx -s 'Testing' mymail@yahoo.com < MESGFILE

This only gives me the contents of MESGFILE as my message.

If I remove the < FILE I recieve the attachment.

What I want is both the attachent and the message in MESGFILE.

I've checked out the FAQ and I would really like to use mailx so I don't have to wait a month to have my admin install any new tools. Any help/ideas would be appreciated.

Never mind, I figured it out, If I uuencode the file to attach first and then cocatenate the 2 files ' cat mesgfile attachfile > combo

and use mailx -s "Test Subject" mymail@yahoo.com < combo

this works,

This is the perfect example for sending email with attachment and the message.

http://www.uaex.edu/bknox/email\_with_attachment.htm

I think following command should work,

( cat mesgfile ; uuencode Test.dat Test.dat ) | mailx -s 'Testing' mymail@yahoo.com

because I like to send mail in my RH Linux 6.0 like this,

(echo From: Eddie [eddie@swh.com]; echo Subject: Testing ; echo To: My friends; cat messagefile ; uuencode -m attach.file1 attachname1 ; uuencode -m attach.file2 attachname2 ) | sendmail `cat recipients-list`

The "recipients-list" contains the email addresses like following, for example,

john@yahoo.com
david@hotmail.com
mark@aol.com
sandy@mail.emerld.com
......

This is handy. You can also put this simple command into a shell script if you like. Note the brackets [ ], they should be angle brackets which are treated like special characters and can not be displayed in this BBS.

Hope this helps.

It works.

Thanks
Sanjay