I have some problem in sending an email, please help me.

Hi,

I am writing a kornshell script, once the successful completion of the script
I need to send an email with body of a text along with an attachment. But i couldnt able to send an email with both body of the text and attachment at the same time in unix. The following is the code i tried,

(cat /apps/documentum/dba/log/test1.txt ; uuencode /apps/documentum/dba/log/test.log test.log) | mailx -s "successful completion" mailaddress

If i execute the above code i am recieving an email, but the attachment also i am recieving as the body of the text in the email.

I dont know how to send both the body of the text and attachment in an email. Similarly in the email i need to change the "From" address, is it possible?

Can anyone please help me on this?

Thanks in advance

try this..

cat /apps/documentum/dba/log/test1.txt | mailx -a uuencode /apps/documentum/dba/log/test.log test.log) -s "successful completion" mailaddress

where (uuencode /apps/documentum/dba/log/test.log test.log)) will get you as an attachment..

thanks,
geeko

Hi,

Unfortuantely this code is not working,

cat /apps/documentum/dba/log/test1.txt | mailx -a uuencode /apps/documentum/dba/log/test.log test.log -s "successful completion" mailaddress

When i execute the above the code it says,

mailx: illegal option -- a
Usage: mailx -eiIUdFntBNHvV~ -T FILE -u USER -h hops -r address
-s SUBJECT -f FILE users

I am using Sun OS 5.8, can anyone please help me?

Thanks in advance.