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

时间:2018-02-01 16:22:49

标签: linux email ubuntu mailx cl

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

etree.XML(r.text)

我像这样运行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>

mailx

它会发送纯文本电子邮件并打印:

mailx -t -S smtp=server.com name@email.com  < file

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

其他消息来源说要使用Ignoring header field "MIME-Version: 1.0" Ignoring header field "Content-Type: text/html; charset=us-ascii" Ignoring header field "Content-Disposition: inline" 标志并指定内容类型,
但我-a版本上的-a是附件;所以这不起作用。

1 个答案:

答案 0 :(得分:1)

使用选项-t时, mailx 过滤出标头字段,仅保留以下字段:

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

任何其他标头都会产生"Ignoring header field"警告消息,并被丢弃。

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