Article 4XNA5 how can I use BCC option in bash mail

how can I use BCC option in bash mail

by
aristosv
from LinuxQuestions.org on (#4XNA5)
I am using sendmail and gmail as a relay for outgoing emails on debian 10. This is the script I use for installing and configuring outgoing emails.

And then I use this in a bash script to send an email

Code:echo "email body" | mail -s "email subject" "myemail@goes.here"This works great.

I need to put the email address in the BCC field though. How can I do that?

I've seen suggestions for using the -b option, but when I do that I get a message saying mail: unrecognized option '-b'

I've also seen suggestions on using something like this

Code:echo -e "body" | mail -S smtp=localhost -s "Test subject 1" -b bccuser@gmail.com user@gmail.comBut then I get a message saying Code:mail: unrecognized option '-S'So how can I put the email address in the BCC field?
Thankslatest?d=yIl2AUoC8zA latest?i=R9gUEHye9AY:KlXFRxM5-lM:F7zBnMy latest?i=R9gUEHye9AY:KlXFRxM5-lM:V_sGLiP latest?d=qj6IDK7rITs latest?i=R9gUEHye9AY:KlXFRxM5-lM:gIN9vFwR9gUEHye9AY
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments