The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Email not sending to Hotmail thehaapyappy UNIX for Dummies Questions & Answers 3 05-12-2008 02:29 AM
Sending email to a User from C++ debu High Level Programming 1 01-23-2008 02:09 AM
Sending email w/ ftp log as attachment idesaj UNIX for Dummies Questions & Answers 2 07-19-2005 08:48 AM
sending email vasikaran UNIX for Dummies Questions & Answers 1 07-05-2005 02:50 AM
Sending email bcheaib UNIX for Dummies Questions & Answers 7 02-22-2005 05:03 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-12-2007
Registered User
 

Join Date: Jul 2007
Posts: 15
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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-12-2007
Registered User
 

Join Date: Sep 2007
Posts: 15
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
Reply With Quote
  #3 (permalink)  
Old 10-12-2007
Registered User
 

Join Date: Jul 2007
Posts: 15
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.
Reply With Quote
Google UNIX.COM
Reply

Tags
mailx, mailx attachment

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:51 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0