我正在使用shell脚本并使用下面的邮件实用程序发送电子邮件。
mail -s "Data Missing report" "normalUser@test.net" < /opt/emailscript/fileToSend.txt
上面的脚本工作正常,如何在列表中添加一些其他用户(例如bccuser@test.net),可以使用相同的实用程序/命令自动生成bcc?
答案 0 :(得分:2)
MAIL(1) BSD General Commands Manual MAIL(1)
NAME
mail - send and receive mail
SYNOPSIS
mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr... [-- sendmail-options...]
mail [-iInNv] -f [name]
mail [-iInNv] [-u user]
-c Send carbon copies to list of users.
-b Send blind carbon copies to list. List should be a comma-separated list of names.
命令是(我在CentOS6.x上测试过):
echo -e "body" | mail -S smtp=localhost -s "Test subject 1" -b bccuser@gmail.com user@gmail.com
to-addr
位于cc-addr
和bcc-addr