|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
mail to multiple recipients
I've searched far and wide (including forums - so please don't tell me to look there) ...and I have a presumably simple request...
how do I specify multiple recipients to send mail to usnig the mail command. I've got this (cat mail_message ; uuencode test.file test.file ) | mail john_smith@the_moon.com However, how do I also send to another recipient on the same command line. Obviouly could replicate the line - but don't think I need to..... ![]() |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
I've got it using mailx - but am still curious about mail
(cat mailtext ; uuencode test.log test.log ) | mailx 'peter@dot.com, john@dot.com' That works....... Simple (with quotes) - but with the mail command (instead of mailx) it says "Recipient names must be specified" |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
I'm on Solaris 2.6 - used the following with no problem:
$ mail joeuser@mycom.com,joeuser@yahoo.com < /etc/motd Worked under ksh and csh. |
|
#4
|
||||
|
||||
|
I've used the following with success in the past. Code:
xemails="cameron@SomeDomain.com,someoneelse@SomeDomain.com"
#
function SendEmail {
xsub="Some Subject Of Your Choosing."
mail -s "$xsub" $xemails < $1
} ## End-of-function SendEmail |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
/etc/aliases
The aliases file for sendmail allows you to point to a file; so the way I do what you are asking is to put the names in a file that is part of /etc/aliases and send mail to the alias.
|
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
On HP-UX I could put a list of recipients separated with just a space, and it worked:
cat $myFile | /usr/lib/sendmail -i -t with in myFile a line like: To: aaa@whatever.com bbb@whatever.com Hope this will help. |
| Sponsored Links | ||
|
![]() |
| Tags |
| sendmail |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sendmail not showing recipients | MaindotC | UNIX for Advanced & Expert Users | 8 | 08-19-2012 08:17 PM |
| Multiple recipients with sendmail | big123456 | UNIX for Advanced & Expert Users | 6 | 12-29-2010 12:40 PM |
| Python: multiple email recipients | jelloir | Programming | 0 | 12-08-2009 05:16 PM |
| using mailx with multiple recipients | sdhalepaska | UNIX for Dummies Questions & Answers | 6 | 08-18-2008 05:17 AM |
| Mail to multiple reciepent | arpitk | Shell Programming and Scripting | 4 | 11-02-2006 09:30 AM |
|
|