Mailx with attachment and message body

i have to attach the 'body in the email' along with attachment below code is throwing errors, how can i do it ?

here body file contains message, it should display in email, please help

i am using HP-UX

 
(cat body ;) (uuencode attch1 attch1 ;) | mailx -m -s "testing" "abc@gmail.com"

---------- Post updated at 11:00 AM ---------- Previous update was at 10:59 AM ----------

 
error : ksh: syntax error: `(' unexpected

try this

(cat body ; uuencode attch1 attch1) | mailx -m -s "testing" "abc@gmail.com"
1 Like

thanks subramanian :slight_smile:

if i want to attach 2 text files then ?

( cat body.txt; uuencode file1 file1; uuencode file2 file2; ) | mailx -m -s "Att" user@domain.com
1 Like

@bipin ......you are awesome ....... thanks