I tried the below command

uuencode data.txt | mailx –s “Test Mail” “mrp@xyz.com”

But I get the below error

ksh: uuencode: not found.
Null Message body;  hope that' ok

which clearly tell that uuencode utility is not found.

I there any other way to send attachments with mail through command line. At the same time I don't have admin access for the same to install the utility (I use AIX 5. version Server)

  • which version of mailx do you have? Sometimes there is a -a option for attachments. – user1766760 Feb 20 '14 at 18:32

mailx can not send attachments and you don't have uuencode. If you have mime-construct, then it is relatively easy:

 mime-construct --output \
                --to "bernhard@localhost" \
                --file-attach fish.zip \
                --string here_you_are

the output:

To: bernhard@localhost
MIME-Version: 1.0 (mime-construct 1.9)
Content-Type: multipart/mixed; boundary=congratulations

Content-Disposition: attachment; filename=fish.zip
Content-Type: application/zip; name=fish.zip
Content-Transfer-Encoding: base64


Content-Transfer-Encoding: base64



together with mailx:

mime-contruct --your-options | mailx -s your_subject youruser@domain
  • @user55518 there is a typo I cannot edit (as the edition is less than 6 characters) :s/mime-contruct/mime-construct – Manu H Dec 4 '15 at 10:56

Try with the following

uuencode <old-filename> <New filename> |mailx -s <filename> mailid
  • "ksh: uuencode: not found" and "I don't have admin access for the same to install the utility" – Jeff Schaller Feb 3 '16 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.