我们的生产服务器已经退役,现在我们使用的是运行 Redhat GNU/Linux 的托管系统。
我们有很多脚本使用 mutt 来发送文件附件,但它们现在都失败了,因为我们的服务器上没有安装 mutt(系统管理员政策是 mutt 不安全,所以不会安装)
我曾尝试使用 mailx 但无济于事。当我做
echo "this is my email body"| mailx -s "this is my email subject" "email@xyz.com" -a "filename.csv"
Run Code Online (Sandbox Code Playgroud)
我得到
$ send-mail: illegal option -- a
Run Code Online (Sandbox Code Playgroud)
“filename.csv”存在并且它是我运行命令的目录的本地目录。当然,当我这样做
mailx -s "this is my email subject" "email@xyz.com" < "filename.csv"
Run Code Online (Sandbox Code Playgroud)
它可以工作,但它将文件附件嵌入到电子邮件正文中。用户不希望那样。
我究竟做错了什么?
我想到了。我只是像这样在电子邮件地址之前移动了 -a 标志
echo "this is my email body"| mailx -s "this is my email subject" -a "filename.csv" "email@xyz.com"
Run Code Online (Sandbox Code Playgroud)
它工作得很好。
| 归档时间: |
|
| 查看次数: |
9855 次 |
| 最近记录: |