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)

Ram
  • 383

2 Answers2

2

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-construct --your-options | mailx -s your_subject youruser@domain
cas
  • 78,579
  • @user55518 there is a typo I cannot edit (as the edition is less than 6 characters) :s/mime-contruct/mime-construct – Manu H Dec 04 '15 at 10:56
-1

Try with the following

uuencode <old-filename> <New filename> |mailx -s <filename> mailid
jasonwryan
  • 73,126
Rajani
  • 1