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
Help with mail command hern14 UNIX for Dummies Questions & Answers 2 05-15-2008 06:25 AM
Mail command FeNiCrC_Neil UNIX for Dummies Questions & Answers 2 08-31-2007 10:12 AM
mail command on sco box benefactr UNIX for Advanced & Expert Users 0 08-17-2007 02:29 PM
mail command habuzahra UNIX for Dummies Questions & Answers 4 01-08-2007 06:00 AM
mail command garric Shell Programming and Scripting 4 04-24-2006 01:09 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-31-2006
Registered User
 

Join Date: Apr 2006
Posts: 16
Help with mail command

Hi Friends,

While sending a mail from a shell script, is there a way i can mark some names in the To list and for some names i need then to be in the cc list.

Are there any options available for the same with the mail or mailx xommands where i can specify the names to be present in To : list or cc: list.

Thanks in advance
Reply With Quote
Forum Sponsor
  #2  
Old 08-01-2006
Hitori's Avatar
Registered User
 

Join Date: Jun 2006
Posts: 360
mail -c cc-addr to-addr
Reply With Quote
  #3  
Old 08-01-2006
Dhruva's Avatar
Registered User
 

Join Date: Mar 2006
Location: India
Posts: 255
You can try with send mail utility...here is a script

SUBJ="Send mail from Unix with file attachments"
TO=urmail.com
CC=otherrec.com,onemore.com
(
cat << !
To : ${TO}
Subject : ${SUBJ}
Cc : ${CC}
!

cat << !
HOPE THIS WORKS
you got the mail from sendmail utility
!

uuencode watch_script1.txt watch_script1.txt
!

) | sendmail -v ${TO} ${CC}
Reply With Quote
  #4  
Old 08-01-2006
Hitori's Avatar
Registered User
 

Join Date: Jun 2006
Posts: 360
Quote:
Originally Posted by Dhruva
uuencode -m watch_script1.txt watch_script1.txt
! <must be removed
And how about MIME-headers?
Reply With Quote
  #5  
Old 08-01-2006
Dhruva's Avatar
Registered User
 

Join Date: Mar 2006
Location: India
Posts: 255
yes you are right "!" must be removed after uuencode command.Thanks for correcting me.I am not sure about MIME headers may be you can elaborate on this....thanks
Reply With Quote
  #6  
Old 08-01-2006
Hitori's Avatar
Registered User
 

Join Date: Jun 2006
Posts: 360
I've asked whether sendmail will add MIME-headers or they must be added manually??
Reply With Quote
  #7  
Old 08-01-2006
Registered User
 

Join Date: Apr 2006
Posts: 16
Hi Hitori,

I tried using
mail -s "This is the subject" -c cc-abc.com to-def@gillette.com < $HOME/mail_contnts.txt

it is giving me invalid options error.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
sendmail

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 11:36 PM.


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

Content Relevant URLs by vBSEO 3.2.0