Aix Unix Mailx Attachments

I'm trying to send a mailx with an attachment, really I have not do it in a long time. I forgot

If you search the site Perderabo used to have a post that he gave a script that could handle attachments. I don't know if it is still available since the site was updated...

I have used it and it works very well...

You can send an attachment like below :-

uuencode filename filename | mailx -s "Subject" user.domain.com

If you also want Text in the mail body as well as the attachment :-

(cat somefile.txt ; uuencode filename filename) | mailx -s "Subject" user.domain.com

Hi

I'm trying to send mail using mailx from AIX 5.3 with multiple attachments and message body. I was able to perform the activity using two different commands and there are some issues with both the commands

(echo "`cat ${BASE_DIR}/mail/PMS_error.txt`"; uuencode $SCRIPTLOG PMSReleaseLog.txt && uuencode ${BASE_DIR}/errors/actualdataloaderr.txt ActualDataLoadErr.txt && uuencode ${BASE_DIR}/errors/discretedataloaderr.txt DiscretionaryDataLoadErr.txt && uuencode ${BASE_DIR}/errors/evpdataloaderr.txt EVPDataLoadErr.txt && uuencode ${BASE_DIR}/errors/targetdataloaderr.txt TargetDataLoadErr.txt && uuencode ${BASE_DIR}/errors/weightdataloaderr.txt WeightDataLoadErr.txt) | mailx -s "PMS Release - Data loaded to Essbase cube but there were errors, please check the dataload error files for the detail" bscuser1@mycom.com.tr bscuser2@mycom.com.tr

This command has an issue when a file mentioned in the uuencode is not existing it gives an error and will not proceed with sending the other file.

  1. uuencode /hyperion/Hyperion/Isbank_PMS/errors/actualdataloaderr.txt ActualDataLoadErr.txt > PMS.txt
    uuencode /hyperion/Hyperion/Isbank_PMS/errors/discretedataloaderr.txt DiscretionaryDataLoadErr.txt > PMS1.txt
    uuencode /hyperion/Hyperion/Isbank_PMS/errors/evpdataloaderr.txt EVPDataLoadErr.txt > PMS2.txt
    uuencode /hyperion/Hyperion/Isbank_PMS/errors/targetdataloaderr.txt TargetDataLoadErr.txt > PMS3.txt
    uuencode /hyperion/Hyperion/Isbank_PMS/errors/weightdataloaderr.txt WeightDataLoadErr.txt > PMS4.txt
    cat /hyperion/Hyperion/Isbank_PMS/mail/PMS_error.txt PMS.txt PMS1.txt PMS2.txt PMS3.txt PMS4.txt | mailx -m -s "PMS Release - Data loaded to Essbase cube but there were errors, please check the dataload error files for the detail" bscuser1@mycom.com.tr bscuser2@mycom.com.tr

I tried this script but then it is giving me an error message
mailx: Not a recognized flag: m
3.
uuencode $SCRIPTLOG PMSReleaseLog.txt > PMS
uuencode /hyperion/Hyperion/Isbank_PMS/errors/actualdataloaderr.txt ActualDataLoadErr.txt >> PMS
uuencode /hyperion/Hyperion/Isbank_PMS/errors/discretedataloaderr.txt DiscretionaryDataLoadErr.txt >> PMS
uuencode /hyperion/Hyperion/Isbank_PMS/errors/evpdataloaderr.txt EVPDataLoadErr.txt >> PMS
uuencode /hyperion/Hyperion/Isbank_PMS/errors/targetdataloaderr.txt TargetDataLoadErr.txt >> PMS
uuencode /hyperion/Hyperion/Isbank_PMS/errors/weightdataloaderr.txt WeightDataLoadErr.txt >> PMS
cat /hyperion/Hyperion/Isbank_PMS/mail/PMS_error.txt >> PMS
cat PMS |mail -s "PMS Release - Data loaded to Essbase cube but there were errors, please check the dataload error files for the detail" bscuser1@mycom.com.tr bscuser2@mycom.com.tr
I tried to do this using another command and this is not sending the message body only attachments (but this was working previously)

Can somebody help me with this?