Mail to: cc: How can i acheive this with ksh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Mail to: cc: How can i acheive this with ksh
# 1  
Old 01-29-2009
Java Mail to: cc: How can i acheive this with ksh

Hi All,

I have to write a script to send mail, in that i have to dynamically
add the recepient in TO and my cc is a common one.
For all mails my cc recepients are same. Only problem with TO recepient.

Please i am looking for your inputs.
# 2  
Old 01-29-2009
Try:

MAIL=""
TO=""
while [ $MAIL <> "END" ]
do
echo "Enter TO email adress : \c"
read $MAIL
TO=`echo "$TO $MAIL "`
done
mailx -s subject -c yourCC $TO < anytext.file

You enter "END" as email adress to ends the input loop
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Merging 2 slightly differnet shell scripts together to acheive same outcome

hi all. i have a kimsufi server, and i am wanting to it to syncronise back to my home linux system, but i want it to track what files have been transfered, so that if i move or delete them on my system, they wont re-sync back. i have googled around and found 2 scripts that acheive this, but... (1 Reply)
Discussion started by: jbates58
1 Replies

2. Shell Programming and Scripting

Ksh: Send a mail in case grep finds something

I want to search a file if it contains special strings and if yes, the records found should be mailed. I can either do it with a temporary file: /usr/bin/grep somestring somefile > /tmp/tempfile && /usr/bin/mail -s "Found something" email@mycomp.com < /tmp/tempfile... or by running the grep... (10 Replies)
Discussion started by: Cochise
10 Replies

3. Shell Programming and Scripting

HTML Report from mail in ksh 88

Hi Team, I'm trying to send HTML Report from email using the below script (Using ksh 88 version) #!/bin/ksh set -x SUB="Test Email" Mail_Body="This is for testing" Send_Mail_HTML() { ( echo "FROM: abcd@test.com" echo "To: abcd@test.com" echo "Subject:... (2 Replies)
Discussion started by: smile689
2 Replies

4. Shell Programming and Scripting

ksh and mail problem

Script A: #!/bin/ksh /usr/bin/mail -s "case 4" g@f.com <testF5Email.inp Script B: #!/bin/ksh qq="-s \"case 4\" cstsang@hko.hksarg" /usr/bin/mail $qq<testEmail.inp Script A working properly where Script B cannot. The error message as the following: There is a missing '"' character... (3 Replies)
Discussion started by: cstsang
3 Replies

5. Shell Programming and Scripting

KSH - mailx - Redirect the undelivered mail

Hi, I need to create one KSH which will send mail to set of recipients using "mailx" command like below. mailx -s "Test mail" "test@yahoo.com, test@gmail.com" <$output.txt The recipients are in different domains (like yahoo, gmail, etc.). My requirement is, if any mail is undelivered,... (1 Reply)
Discussion started by: Matrix2682
1 Replies

6. Shell Programming and Scripting

KSH Programming to read and mail fields

I have a file with the following values: File name à a.log (bulk file with 100+ lines with the similar format) aaaa|bbbb|cccc|dddd|eeee|ffff|gggg|hhhh|iiii| aaaa|bbbb|cccc|dddd|eeee|ffff|gggg|hhhh|iiii| aaaa|bbbb|cccc|dddd|eeee|ffff|gggg|hhhh|iiii|... (3 Replies)
Discussion started by: shivacbz
3 Replies

7. Shell Programming and Scripting

Send an e-mail using ksh

Hi, I have a small script that outputs to a text file. I need to e-mail the contents of the text file to a mail alias. However, I cannot seem to get the script to print the 'subject', my script just leaves it blank. Has anybody any ideas what is wrong? if then (echo "\nHere is the report... (3 Replies)
Discussion started by: asulli01
3 Replies

8. Shell Programming and Scripting

How to acheive ALT+Enter of xls in Unix ksh/sqlplus

Hi, I am using sqlplus (called inside my ksh) to create a file which is mailed to the users as an xls. There is one DESCRIPTION column which is currently coming as wrapped, but, the users want a new line for each of the fields present in the desricription column. Below is an example - ... (11 Replies)
Discussion started by: Sree_2503
11 Replies

9. UNIX for Dummies Questions & Answers

help on sending mail in ksh

folks, I wrote a script like follow for sending notification email, but the problem is cannot pass the multiple words to the subject line, any help: ======================================= send_msg () { send_email $1 exit 1; } send_email () { mail -s $1 $mail_address << MAIL... (2 Replies)
Discussion started by: ting123
2 Replies

10. Shell Programming and Scripting

Using $MAIL in ksh

I'm trying to write a menu script in ksh to allow a user to find his/her mail path. Display the mail file path") print -n "Mail File Path: " $MAIL It's not working although it works when I'm simply doing it from the command line. Also, I'm using the same formula to find the shell path... (2 Replies)
Discussion started by: r0mulus
2 Replies
Login or Register to Ask a Question