- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Mailx and recipients
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
Discussions
Discussions
Forums
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
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
тАО12-18-2002 07:42 AM
тАО12-18-2002 07:42 AM
I???m trying to figure out how to send mail to more than one person using ???mailx??? through a command line only interface without having each person I send it to show up in the ???To:??? section of the final mail (I would like some of them to be in the ???CC:??? section and others to be in the ???BCC:??? section as well).
The syntax I have been using that seems to work well at getting the body of the message out with the proper subject line is:
Echo <-message body-> | mailx ???s ???<-subject->??? <-recipients e-mail addresses->
What do I do to identify which e-mail address goes in which category? Reading the man page on mailx has only made my head hurt and a few more hairs fall out (I can???t afford much more of that!).
Does anybody have the magical answer to my problem (PLEASE!)??
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 07:48 AM
тАО12-18-2002 07:48 AM
Re: Mailx and recipients
You could setup an alias in /etc/mail/aliases. We do that for our e-mail from root, and the "To:" field just lists the alias name and not all the individual accounts receiving the message. Just put the entries in /etc/mail/aliases, and then run the 'newaliases' command.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 07:57 AM
тАО12-18-2002 07:57 AM
Re: Mailx and recipients
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 08:07 AM
тАО12-18-2002 08:07 AM
Re: Mailx and recipients
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 08:15 AM
тАО12-18-2002 08:15 AM
Re: Mailx and recipients
See the attached script for a starting point.
Good Luck
Rich Wright
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 08:22 AM
тАО12-18-2002 08:22 AM
Re: Mailx and recipients
---
~t to1@home.com
~t to2@home.com
~c cc1@home.com
~c cc2@home.com
~b bcc1@home.com
~b bcc2@home.com
~s Subject line
Message waffle yada yada
---
Then do cat msg.txt | mailx to1@home.com
Then again for each of the addresses.
The ~ commands populate the sendmail header, so the recipients can see where it goes. Then send the same file to each user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 08:37 AM
тАО12-18-2002 08:37 AM
Re: Mailx and recipients
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2002 09:21 AM
тАО12-18-2002 09:21 AM
Re: Mailx and recipients
My recipient list does have a way of changing (but then again, doesn't EVERYTHING in the IT world?) so I don't think that a static alias file would be my correct course of action. Thanks for the input, though.
Rich,
I was already aware of the fact that mailx isn't my best choice, but for the time being it is the one that I am stuck with. I will hold your script for a later day though. I'm sure that I will have a chance to make use of it one of these days. Thanks.
Simon,
Your suggestion intrigues me. What I need now is a little clarification on what you are suggesting.
Let's say that I compose a message like:
echo This is a test message | mailx -s "Test1" ~t me@home ~t meagain@home ~c someone_else@home ~b silent_partner@home.com
Will this accomplish what I need or do I need to put some single or double quotes in there somewhere?
My other goal is to impliment this into an OV NNM aplication, so I would like a single line that I can predefine that will do this.
Am I on the right track or is there more?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2002 12:56 AM
тАО12-19-2002 12:56 AM
SolutionYour suggestion to incorporate the ~t ~c ~b in the recipient list in the command line, will only lead mailx(1) to interpret these as 'extra' recipients of localhost. i.e.:
echo "Hi" | mailx -s "Test" ~t me@home.com ~c you@home.com ~b her@home.com
will resultin a
To: ~t@localhost me@home.com ~c@localhost you@home.com ~b@localhost her@home.com
where the ~-recipients will not resolve, and the other recipients will be exposed.
If you want a single command line, in your OV NNM application, you should call a script, feeding it the info you want to send, and in this script, build the suggested text-file with ~-commands at the start of the text-file for recipient info. Next from the script, you perform the mail command: cat
next clean up your text-file.
HTH
Kasper Haitsma
Messaging &OVO-Ux Competence Center Engineer
Hewlett Packard Nederland B.V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2002 09:36 AM
тАО12-19-2002 09:36 AM
Re: Mailx and recipients
So what you're telling me is that there is truly no way to accomplish what I want to do without creating a script?
Well, I'm sorry to hear that because my script writing abilities rank right up there with my abilities to create world piece, but I am grateful for all of the assistance you and the others have given.
It would appear that I should now be off on my next quest;
The Quest for the Holy E-mail Script!
Thanks to you all and Happy Holidays...