查看一下mail命令的帮助: man mail
mail [-iInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr... [-- sendmail-options...]
参数说明:
(1)-s subject 指定要发送邮件的主题
(2)-c recient抄送
(3)-b recipients 秘密抄送(收件人间用逗号隔开)
(4)-- sendmail-options sendmail的一些选项,如
-F full_name 发件人全名
-f sender 设置信封上发件人的地址
举例如下:
mail -s "this is a test" -c test@hust.com -b test@test.com test@zy.com < eicar.txt -- -f test@test2.com -F zhangyang
向test@zy.com 发送一封邮件,主题为”This is a test”,发信人地址是test@test2.com,显示名为zhangyang,并抄送给test@hust.com,秘密抄送给test@test.com