为什么mailx会忽略标题字段?

Tre*_*key 7 linux email ubuntu mailx cl

我想发送一封HTML电子邮件.
有一个纯文本文件,如下所示:

From: "name" <name@email.com>
To: name@email.com
Subject: First Email
MIME-Version: 1.0
Content-Type: text/html; charset=us-ascii
Content-Disposition: inline

<strong>Hello, World!</strong>
Run Code Online (Sandbox Code Playgroud)

mailx像这样跑,

mailx -t -S smtp=server.com name@email.com  < file
Run Code Online (Sandbox Code Playgroud)

它发送一个纯文本电子邮件,然后打印:

Ignoring header field "MIME-Version: 1.0"
Ignoring header field "Content-Type: text/html; charset=us-ascii"
Ignoring header field "Content-Disposition: inline"
Run Code Online (Sandbox Code Playgroud)

为什么?
如何发送HTML电子邮件?

其他消息来源说使用-a标志并指定内容类型,
-a在我的版本mailx是附件; 所以这不起作用.

irc*_*ama 1

当使用 option 时-tmailx会过滤掉标头字段并仅保留以下字段:

  • to:
  • cc:
  • bcc:
  • from:
  • reply-to:
  • sender:
  • organization:

任何其他标头都会产生“忽略标头字段”警告消息并被丢弃。

这在手册中实际上是很神秘的。