1748182 Members
3386 Online
108759 Solutions
New Discussion юеВ

mailx question

 
SOLVED
Go to solution
David_385
New Member

mailx question

Hello to everybody:

I'm having a little and stupid problem but I think my head isn't in its place.
I have a shell tath every time it finishes it sends a mail, I make it in this form:

mailx -s "$vSubject" "$vRecipients" < $1/$fFicheroMail

How can I send a hide copy ( Bcc )???
I try with -b option but i didn't find a good way
6 REPLIES 6
Paul Sperry
Honored Contributor

Re: mailx question

~b name ... Add name to the blind carbon copy (Bcc) list.

Thats tildi not dash

~ not -
Uday_S_Ankolekar
Honored Contributor
Solution

Re: mailx question

you can use ~b for bcc and ~c for cc.
Try this out ..
/usr/bin/mailx -s "subject" yourname@yourdomain < myfile

In "myfile", you can type:

~c 12345@abcde.com
~b 34567@abcde.com


~c and ~b lines will not appear in the mail contents.
man mailx for info..

-USA..

Good Luck..
Pete Randall
Outstanding Contributor
Darren Prior
Honored Contributor

Re: mailx question

I'm afraid that mailx only allows you to use Bcc in interactive mode.

An alternative solution is to append your $1/$fFicheroMail file to a file containing the following lines:

To: your list of recipients
Bcc: your bcc list
Subject: your subject

then cat the whole lot to sendmail -t. Check the man page for sendmail; the -t option means to get the recipient data from the message.

regards,

Darren.
Calm down. It's only ones and zeros...
Pete Randall
Outstanding Contributor

Re: mailx question

David,

I think you'll have better luck using sendmail or elm. Check the link I gave you or search the forums for "sendmail and copy".


Pete

Pete
Chris Vail
Honored Contributor

Re: mailx question

Try mutt instead of mailx: http://www.mutt.org. It compiles easily and has a lot of command line options.



Chris