在unix mailx中发送带有CC BCC和发件人地址的电子邮件

问题描述:

我想使用mailx命令从HP UNIX发送电子邮件. 我必须在电子邮件中包含抄送和密件抄送,并且必须使用特定的电子邮件地址作为发件人.

I want to send email from HP unix using mailx command. I have to include cc and bcc in my email and have to use the specific email address as the sender.

但是-r(用于定义发件人的电子邮件地址)将禁用〜命令,因此,如果我必须定义发件人的电子邮件地址,则无法对cc和bcc使用〜c和〜b命令.

But -r (which is to define the sender's email address) will disalbe ~ commands so if i have to define the sender's email address, i cannot use ~c and ~b commands for cc and bcc.

有什么解决方法吗???因为这些是用户的要求.

Is there any work around???? cos these are the requirements from the user.

谢谢.

只需对mailx命令的参数重新排序.这样可以达到预期的效果

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