The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-01-2006
Rohini Vijay Rohini Vijay is offline
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
  #2 (permalink)  
Old 08-01-2006
Hitori's Avatar
Hitori Hitori is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2006
Posts: 360
mail -c cc-addr to-addr
  #3 (permalink)  
Old 08-01-2006
Dhruva's Avatar
Dhruva Dhruva is offline
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}
  #4 (permalink)  
Old 08-01-2006
Hitori's Avatar
Hitori Hitori is offline Forum Advisor  
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?
  #5 (permalink)  
Old 08-01-2006
Dhruva's Avatar
Dhruva Dhruva is offline
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
  #6 (permalink)  
Old 08-01-2006
Hitori's Avatar
Hitori Hitori is offline Forum Advisor  
Registered User
  
 

Join Date: Jun 2006
Posts: 360
I've asked whether sendmail will add MIME-headers or they must be added manually??
  #7 (permalink)  
Old 08-01-2006
Rohini Vijay Rohini Vijay is offline
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.
Closed Thread

Bookmarks

Tags
sendmail

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:13 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0