Discussion:
how to send mail to multiple recipients
(too old to reply)
tony
2005-03-07 19:25:51 UTC
Permalink
I need to send mail like this

echo test | mail ***@domain.com ***@domain.com

how do I send mail to multiple people? Is this the right syntax?
p***@gmail.com
2005-03-07 19:49:42 UTC
Permalink
Check out the man pages for mail and mailx. They'll provide you with
all of the syntax and options for each command and will likely answer
all of your questions and (not) fulfill your wildest dreams ;)
Heiner Steven
2005-03-11 21:55:21 UTC
Permalink
Post by tony
I need to send mail like this
how do I send mail to multiple people? Is this the right syntax?
while read address
do
echo test | mail "$address"
done < address.list

Heiner
--
___ _
/ __| |_ _____ _____ _ _ Heiner STEVEN <***@nexgo.de>
\__ \ _/ -_) V / -_) ' \ Shell Script Programmers: visit
|___/\__\___|\_/\___|_||_| http://www.shelldorado.com/
jpd
2005-03-11 22:26:48 UTC
Permalink
Post by Heiner Steven
Post by tony
I need to send mail like this
how do I send mail to multiple people? Is this the right syntax?
man mail appears to affirm that, yes. On my system, at least.
Post by Heiner Steven
while read address
do
echo test | mail "$address"
done < address.list
You can do that, too, of course. Having less bodies in the spool does
seem appealing, but if sending to strangers one may not want to show
everybody every other address in the To: line.

For which case I tend to construct a list of SMTP commands in a file
and feed it to the MTA directly. But before OP tries that, first read
at least rfcs 821 and 822 and consider that we already have more spam
to go round a couple of times over.
--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
HSP
2005-03-12 00:17:46 UTC
Permalink
for in in ***@domain.com ***@domain.com
do
echo test | mail $i
done

hope this help not for spam
Post by tony
I need to send mail like this
how do I send mail to multiple people? Is this the right syntax?
Loading...