3

I have one piece of code which is mentioned below where it's sending two files as attachment.

mailx  -s "$ms - $cdate $ctime" $ReportGroup < ${mailmsg} >/dev/null 2>&1

Here mailmsg contents some files. Now i am trying to send one more file xyz.csv in the above command. how can i do the same?

Thanks in advance.

Pandiyan Muthu
  • 1,040
  • 4
  • 21
  • 39
  • Add the contents of `xyz.csv` to `${mailmsg}` before the `mailx` invocation, with proper formatting/structure so that it appears to be another attachment... How is the existing `${mailmsg}` being created? Find that and copy the pattern. – twalberg Sep 04 '14 at 14:09
  • Possible dupe of http://stackoverflow.com/questions/17359/how-do-i-send-a-file-as-an-email-attachment-using-linux-command-line/4887607#4887607 – chrisinmtown Feb 24 '15 at 19:16

1 Answers1

0

use uuuencode function something like

(uuencode filename.format filename_to_be_dispalyed_in_attachment.format)|mailx- s "subject" ${mailmsg} >/dev/null 2>&1

dev
  • 732
  • 2
  • 8
  • 29