Sending email with CC BCC and sender's address in unix mailx

有些话、适合烂在心里 提交于 2019-12-05 10:50:59

Just re-order the arguments to mailx command. That would give the desired result

$ echo "something" | mailx -s "subject" -b bcc_user@some.com -c cc_user@some.com  -r sender@some.com recipient@example.com
Ajeesh Varghese

In my case I have to keep multiple id's in cc which has been done by giving the email-id's comma separated one by one as below:

$ echo -e "Hi Team, \n \n Action Needed \n \n Regards, \n XYZ team"| mailx -s "subject" -b bcc_user1@some.com,bcc_user2@some.com -c cc_user1@some.com,cc_user2@some.com -r sender@some.com receiver@xyz.com

Also made use of the echo command to pass multiple lines to mailx utility. Thought it will be helpful.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!