I need to send an e-mail with attachment as a zip file(containing multiple files zipped) using UUENCODE in UNIX(ksh). The mail has to send to multiple users with subject and a mail body. I tried with UUENCODE using the below command, but it is not working.
uuencode $zip_name $zip_name.zip | mailx -s "Mail Subject" "user@mail.com"
- where $zip_name is name of the zip file.
How do I go ahead with this?
Thanks, Arun
I am guessing that the file cannot be located. Otherwise the below code would work just fine.
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
这是解决方案
echo "Your message" | uuencode "/home/ubuntu/test.zip" | mailx -s 'Your Subject' mail@example.com
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.