Operating System - Linux
1829545 Members
1991 Online
109992 Solutions
New Discussion

Easy Question (sendmail)...

 
SOLVED
Go to solution
Kyle D. Harris
Regular Advisor

Easy Question (sendmail)...

This is probly an easy question for most but I can't remember. How do you send sendmail to multiple addresses? Here's what i have in my script.

echo "The crontab has changed" | mail address@mail.com

do i use a comma or ; or what to seperate them?
4 REPLIES 4
Balaji N
Honored Contributor
Solution

Re: Easy Question (sendmail)...

it is comma.

$ cat /etc/hosts | mail balaji, root
$ mail
From balaji Tue Jul 8 21:19:42 2003
Date: Tue, 8 Jul 2003 21:19:41 -0500 (GMT)
From: balaji
....

-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
Caesar_3
Esteemed Contributor

Re: Easy Question (sendmail)...

Hello!

separate the list with comma ","
You can made a list of wanted users/machines
and send to the list.

Caesar
Jerome Henry
Honored Contributor

Re: Easy Question (sendmail)...

Hi,
It's the same for sendmail command, a in your former mail :$
/usr/bin/sendmail toto.com,foo@mydomain.com Don't forget the coma, as second address would be considered otherwise as the sender...

J
You can lean only on what resists you...
Stuart Browne
Honored Contributor

Re: Easy Question (sendmail)...

The other way is to use mail's "-c" flag to send a CC.

echo blah | mail -c user@somwhere otheruser@elsewhere
One long-haired git at your service...