Hello all,
I need to send an attachment and text in the body, both in the same Email.
Below are two cammand that send the required data in separate Emails. I need to combine them so that I get just 1 Email containing the attachment & text in the body.
uuencode ${filename} "${file_}" | mailx -s "WEEKLY AUOMATED TAPOUT RATING AUDIT REPORT" myemail@address.com
#mailx -s "WEEKLY AUOMATED REPORT" myemail@address.com < /export/home/test/summary.txt
Help !
{
cat /export/home/test/summary.txt
uuencode ${filename} "${file_}"
} | mailx -s "WEEKLY AUTOMATED TAPOUT RATING AUDIT REPORT" myemail@address.com
I got the following outtput:
root@machine #{
>cat /export/home/test/summary.txt uuencode ${filename} "${file_}"
>} | mailx -s "WEEKLY AUTOMATED TAPOUT RATING AUDIT REPORT" myemail@address.com
cat: cannot open uuencode
cat: cannot open
I did get the Email on my ID with body but No attachment.
Put uuencode on a new line!
Ive done the following;
root@machine # {
> cat /export/home/test/summary.txt
> uuencode ${filename} "${file_}"
> } | mailx -s "WEEKLY AUTOMATED TAPOUT RATING AUDIT REPORT" myemail@address.com
^C
(Interrupt -- one more to kill letter)
The prompt dosent return back. I have to press Control+C to come back to prompt.
You must define both variables ${filename}
and "${file_}"
!
The first is the file to be read, the second is the name in the attachment.
RudiC
December 20, 2013, 9:52am
7
Does it have to be both in the body? Depending on your mailx
version, you could use the -a
option to attach a file.