【问题标题】:Send plaintext / html mixed e-mails using mutt使用 mutt 发送纯文本/html 混合电子邮件
【发布时间】:2019-10-10 12:42:28
【问题描述】:

我想使用 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、两个正文)会起作用吗?

还有其他的想法吗?

【问题讨论】:

    标签: html plaintext mutt


    【解决方案1】:

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

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

    您可以更进一步,手动生成边界等等。 另见“mpack”(参考:https://www.tecmint.com/send-email-attachment-from-linux-commandline/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-17
      • 2012-08-25
      • 1970-01-01
      • 2010-11-10
      • 2012-11-01
      • 1970-01-01
      相关资源
      最近更新 更多