0

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?

Prasoon
  • 425
  • 1
  • 6
  • 18
  • Consider using MIME instead. It's the current standard for including non-textual data in emails. There are tons of libraries to help you do this correctly. – james.garriss Sep 03 '13 at 19:29

1 Answers1

0

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.

Prasoon
  • 425
  • 1
  • 6
  • 18