- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to specify List of addresses in mailx
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2000 06:05 AM
11-15-2000 06:05 AM
If condition=TURE then
echo ?No Errors? | mailx ?m gulam@regionpeel.on.ca
fi
Now I want to send this message to 12 more persons.
Please let me know what is the easiest way to send this message to list of different recipients from this script.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2000 06:10 AM
11-15-2000 06:10 AM
Re: How to specify List of addresses in mailx
maix -m user1@domain user2@domain user3@domain ...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2000 06:11 AM
11-15-2000 06:11 AM
Re: How to specify List of addresses in mailx
mailx -m mailaddress1 mailaddres2 mailaddress3 ..........
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2000 06:39 AM
11-15-2000 06:39 AM
Re: How to specify List of addresses in mailx
let's guess you have a file containing all the users addresses -> FILE=/tmp/file_addresses
while read -r i
do
echo "whatever you want" | mailx -s "SUBJECT" $i
done < $FILE
I hope this helps
federico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2000 06:47 AM
11-15-2000 06:47 AM
SolutionIf you want to be able to manage the address list from the aliases file, it might be easier to create an alias in the /etc/mail/aliases file ... do the following:
# echo "notifylist: addr1@mydomain.com, addr2@mydomain.com, addr3@mydomain.com, etc" >> /etc/mail/aliases
# newaliases
your line should read
echo $MESSAGE | mailx notifylist
This way if you need to remove someone from the list, you do not have to muck around with the crontab :) Plus you can reuse the list anywhere you would normally use an address!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2000 09:39 AM
11-15-2000 09:39 AM
Re: How to specify List of addresses in mailx
Actually, I take that back: you *can* add message headers to the file or 'here' document used to feed mailx, but they will be separated from the rest of the headers by a blank line, which will probably confuse some mail user and/or transport agents.
For some reason, mailx insists on sending messages using the character set 'X-roman8,' which our 'company standard' mail client (Outlook--ugh) doesn't seem to understand. This forces you to perform an additional step (open the message in an external editor) just to read mail sent by mailx. It wasn't apparent to me (even after reading the man page) how to go about fixing that, so I prefer to go on using sendmail in shell scripts because It Just Works.
There's some more (marginally useful) information on using 'sendmail' in a shell script in this thread: http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x95fb5f260cafd4118fef0090279cd0f9,00.html . (Sure hope that link works.)