Showing results for 
Search instead for 
Did you mean: 

mailx question

Go to solution
Occasional Visitor

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
Paul Sperry
Honored Contributor

Re: mailx question

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

Thats tildi not dash

~ not -
Honored Contributor

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 and ~b lines will not appear in the mail contents.
man mailx for info..


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.


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

Re: mailx question


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".


Chris Vail
Honored Contributor

Re: mailx question

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