3

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
1

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

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

UEsDBBQAAgAIADKluEK3tLL0XAAAAG8AAAAEABUAZmlzaFVUCQADYLSfUSKiAVNVeAQAAAAAAC2K
wQ2AIBAE/1axDSB8tBMLIHDoJXIQOSV2ryb+JjPDHZEu9N2LA4vSkXwg+BiRuG0OeldCLsJaDqTd
rw1ShAYNNZ65wvA/moZ5cu6FVy4wHbCaq/0qyzp+9/AAUEsBAhcDFAACAAgAMqW4Qre0svRcAAAA
bwAAAAQADQAAAAAAAQAAAKSBAAAAAGZpc2hVVAUAA2C0n1FVeAAAUEsFBgAAAAABAAEAPwAAAJMA
AAAAAA==

--congratulations
Content-Transfer-Encoding: base64

aGVyZV95b3VfYXJl

--congratulations--

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
-1

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.