From: antbh@strix.udac.uu.se (Bernhard Helander)
Newsgroups: comp.mail.mush
Subject: Re: How to send mail to multiple recipients
Date: 1 Oct 92 19:58:31 GMT
Organization: Uppsala University
NNTP-Posting-Host: strix.udac.uu.se

Thanks to all who contributed suggestions. In the end I decided to use
a shell script file and it works both to my own satisfaction and to the 
satisfaction of the site-administration. Here is the script file that 
was sent to me by a very generous person:


From muquit@csa.ncat.edu Sun Sep 27 20:53:04 1992
Received: from mcnc.mcnc.org by strix.udac.uu.se with SMTP id AA16323
  (5.65c8/IDA-1.4.4 for <antbh@strix.udac.uu.se>); Sun, 27 Sep 1992 20:52:54 +0100
Received: from csa.ncat.edu by mcnc.mcnc.org (5.59/MCNC/8-10-92)
	id AA18562; Sun, 27 Sep 92 15:50:45 -0400
	for antbh@strix.udac.uu.se
Received: by csa.ncat.edu (4.1/SMI-4.1)
	id AA11068; Sun, 27 Sep 92 15:55:02 EDT
Message-Id: <9209271955.AA11068@csa.ncat.edu>
From: muquit%csa@mcnc.org (MUHAMMAD A. MUQUIT)
Date: Sun, 27 Sep 1992 15:55:02 -0400
X-Organization: Penn State University, University Park
X-Mailer: Mail User's Shell (7.2.4 2/2/92)
To: antbh@strix.udac.uu.se
Subject: Re: mailing to multiple users
Status: ORr

[In the message entitled "Re: mailing to multiple users", On Sep 27,
 antbh@strix.udac.uu.se writes =>

=>Thank you very much! I am not sure I understand how to get your script
=>file running on my system but I shall try it!
=>

I'm sorry that I didn't explain clearly. Ok, i'm including the script
again. You've to save the mail in a file first. then remove everything
including the --->CUT HERE<--- line. then change the mode of the file
to 755 like this:
chmod 755 filename
this will make the file executable. Now you can run the file just
typing the filename [whatever name you give]. let's say the filename is
mall. now if you just type mall, it'll show you the USAGE. if you type

mall letterfile addressfile

it'll send mail to all the people in addressfile. 
letterfile is the file where you wrote you letter.
addressfile will look like this:

someone@somewhere.edu
xxx@wharever.xx.edu

'mall' will send mail to all users in addressfile. but every person
will see that mail is sent to them separately.

If you're using UNIX, I'm sure C shell is there.
Anyway, if you've any trouble, don't hesitate to drop me a line.

--muquit
muquit@hydr06.psu.edu
Penn State University.

------>CUT HERE<-----
#!/bin/csh -f
#    
#
#e-mail: muquit@garfield.ncat.edu
#        muquit@mercury.ncat.edu
#        muquit@hydr06.psu.edu
set progname=$0
set progname=${progname:t}
set usage = " $progname letter_file address_file "
set descp = " [ one address per line ]"
set arg = "$#argv"
#
set number = $arg
if ($number < 2 ) then
echo ''
echo "USAGE:"
echo " $usage $descp "
echo ''
exit 1
endif

echo -n "Enter the Subject of your mail:"
set c = $<

if ( $arg == 2 ) then
foreach i (`cat $2`)
mail -s "$c" $i < $1
end
endif
if ( $arg == 2 ) then
set no_user = `wc -l < $2`
echo "Mail delivered to [$no_user] Users"
endif

-- 


-- 
*****************************************************************************
*                                  *                                        *
* Bernhard Helander                * Telephone: +46-18-182289 (office)      *
* Dept of Cultural Anthropology    *            +46-18-303448 (home)        *
* University of Uppsala            *                                        *
* Tradgardsgatan 18                * Fax:       +46-18-151160               *
* S-753 09 Uppsala                 *                                        *
* Sweden                           * E-mail: Bernhard.Helander@antro.uu.se  *
*                                  *                                        *
*****************************************************************************