我想发送一封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
是附件;所以这不起作用。
答案 0 :(得分:1)
使用选项-t
时, mailx 过滤出标头字段,仅保留以下字段:
to:
cc:
bcc:
from:
reply-to:
sender:
organization:
任何其他标头都会产生"Ignoring header field"警告消息,并被丢弃。
这在手册中实际上是秘密的。