Question

This particular piece of code below worked correctly on AIX

( echo "mailbody";
  uuencode a.txt 'arenamed.txt';
  uuencode ab.txt 'abrenamed.txt';
  uuencode abc.txt 'abcrenamed.txt';
  uuencode abcd.txt 'abcdrenamed.txt'; ) | mailx -s "$subject" $emailaddress;

But on Linux, any occurrence of uuencode is printing begin 644 blocks in the body of the email viewed on Outlook 2010.

begin 644 abc.txt
5:F%H<V1L:G-A"F%S9&MJ87-J9#L*
`
end

I have tried, using different variations of ( echo $body ; uuencode filename filenamechanged ) with echo first, uuencode later and vice versa but it doesn't help. I would have used "mail -a" but I want to rename files which are emailed, so, was looking at uuencode.

Any suggestions other than using sendmail/mutt here?

Was it helpful?

Solution

This is what worked

(echo "Subject: $Mail_Subject";
echo "To:$Mail_List";
echo $Mail_Body;
uuencode $LOG_DIR/FileName1 'AttachmentDisplayName1';
uuencode $LOG_DIR/FileName2 'AttachmentDisplayName2') | sendmail -t $Mail_List

Hope this helps anyone who is looking for this kind of issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top