我一直在使用
mail -s "here is a log file" "person@example.com" < log/logfile.log
过去常常带有标题:
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
但是现在文件更长了,我收到了无名附件,因为这样:
User-Agent: Heirloom mailx 12.4 7/29/08
MIME-Version: 1.0
Content-Type: application/octet-stream
Content-Transfer-Encoding: base64
因此,如果所有其他方法都失败了,请查看手册man mail
...
NAME
mailx - send and receive Internet mail
SYNOPSIS
mailx [-BDdEFintv~] [-s subject] [-a attachment ] [-c cc-addr] [-b bcc-addr] [-r from-addr] [-h hops]
[-A account] [-S variable[=value]] to-addr . . .
这些选项似乎都没有用,所以我该如何强制Content-Type: text/plain
?