【问题标题】:Send e-mail with custom From: and Cc:使用自定义 From: 和 Cc: 发送电子邮件
【发布时间】:2016-10-17 03:23:21
【问题描述】:

我正在尝试通过在 unix VI 上使用此命令来自动化我的电子邮件:

echo 'Message body goes here' | mail -s 'subject line goes here' email@provider.com

但是,我想添加一个“抄送”并使用不同的电子邮件地址来显示我何时将电子邮件发送给收件人。

【问题讨论】:

  • 我找到了抄送,但 from -r 在我的系统上不起作用。

标签: linux shell


【解决方案1】:

mailx 通常与邮件链接。

尝试通过在末尾添加双破折号然后指定 -f(来自)或 -r(返回)来将选项传递给 sendmail:

mailx ....    -- -r returnname@domain.com

mailx ....    -- -f returnname@domain.com

你也可以尝试here中提到的“-a”选项

mailx -a 'From:name@your-domain.com'  ...

如果你想试试sendmail:

sendmail -t <<EOF
To: toname@domain.com
Subject: Hi
From: fromname@domain.com
Reply-To: replyname@domain.com
Hello
EOF

【讨论】:

  • 邮件:无效选项 -- a
  • 您是否尝试过使用 mailx 的“--r returnname@domain.com”(在命令行末尾)?
  • 是不是:mailx -- -r 'emailaddress@provider'
  • 是的。由于某种原因,我的浏览器无法添加代码、突出显示、下划线字符。 ....您输入的内容是正确的。您将所有其他选项放在 mailx 和双破折号之间。
  • 我记得你提到你的邮件不支持'-a',对吧?我想那么here 提到的 REPLYTO 也不适合你?
猜你喜欢
  • 2012-01-12
  • 2012-07-02
  • 2017-01-25
  • 2021-01-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多