How to send a zip file using UUENCODE on unix

I need to send an email with an attachment in the form of a zip file (containing several files with zipped) using UUENCODE on UNIX (ksh). The letter should be sent to several users subject and mailbox. I tried with UUENCODE using the command below, but it does not work.

uuencode $zip_name $zip_name.zip | mailx -s "Mail Subject" "user@mail.com" 

- where $zip_name is name of the zip file.

How should I do it?

Thanks Arun

+3
source share
3 answers

Most likely, you get too much data for the mail body. Try to use split(1)it to share it or even better look on the Internet at various incarnations sharand make a shar file. Many of them will automatically split the file.

UUENCODE/UUDECODE sharutils.

+1

, . .

zip_name=some_file.zip
MESSAGE_BODY="Some text."
(printf "%s\n%s\n" "$MESSAGE_BODY"; uuencode $zip_name $zip_name)| mailx -s "${SUBJECT}" $TO
+1

Here is the solution

echo "Your message" | uuencode "/home/ubuntu/test.zip" | mailx -s 'Your Subject' mail@example.com
0
source

Source: https://habr.com/ru/post/1784652/


All Articles