使用mutt发送明文/ html混合电子邮件

时间:2017-03-19 16:19:30

标签: html plaintext mutt

我想使用mutt发送混合明文/ HTML电子邮件。

由于边界ID未设置(当然),因此无法工作。

mutt -s "mixed body test" me@mydomain.tld < plaintext_html_body.txt

这是我从Gmail帐户发送的混合电子邮件示例。这或多或少是电子邮件的源代码应该是这样的。

...
Content-Type: multipart/alternative; boundary=94eb2c088fb8697aed054afba7bf
...

--94eb2c088fb8697aed054afba7bf
Content-Type: text/plain; charset=UTF-8

This is a HTML Test
This is a HTML Test

--94eb2c088fb8697aed054afba7bf
Content-Type: text/html; charset=UTF-8

<div dir="ltr">
<span style="background-color:rgb(0,255,255)">
This is a HTML Test<br>
</span>
<span style="background-color:rgb(69,129,142)">
This is a HTML Test<br>
</span>
</div>

--94eb2c088fb8697aed054afba7bf--

mutt可以自动生成Content-Type:标题(包括边界ID),还是有任何一种允许组合明文和html主体的机制?

如果全部发生故障,手动生成整个身体(包括Content-Type:标题,边界ID,两个身体)是否有效?

任何其他想法?

1 个答案:

答案 0 :(得分:0)

由于mutt允许您编辑电子邮件标题,因此您可以在撰写邮件时手动插入内容类型行。

Content-Type: text/plain; charset=utf-8
Subject: yadayada

您可能可以走得更远,并手动生成边界和其他内容。 另请参见“ mpack”(参考:https://www.tecmint.com/send-email-attachment-from-linux-commandline/

相关问题