【问题标题】:Which is best way to add footer text in email?在电子邮件中添加页脚文本的最佳方法是什么?
【发布时间】:2016-05-05 10:24:53
【问题描述】:

我的目标是修改 MIME 内容并在电子邮件中添加页脚注释,而不改变其行为。

如果电子邮件内容类型是文本/纯文本,那么我将电子邮件内容类型更新为多部分/混合,如下所示:

Content-Type: multipart/mixed;
Boundary="--=_SAMPLE_MIME_BOUNDARY_"

email original data

----=_SAMPLE_MIME_BOUNDARY_
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit

!-- Sample footer note --!
----=_SAMPLE_MIME_BOUNDARY_--

如果电子邮件内容类型默认为多部分/混合,那么我正在更新的电子邮件内容如下:

Content-Type: multipart/mixed;
boundary="----=_SAMPLE_MIME_BOUNDARY_"

------=_SAMPLE_MIME_BOUNDARY_
Content-Type: text/plain;
Content-Transfer-Encoding: 8bit

email data

------=_SAMPLE_MIME_BOUNDARY_
Content-Type: application/octet-stream;
name="test_attachment"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test_attachment"

<<attachment data>>

------=_SAMPLE_MIME_BOUNDARY_
Content-Type: text/plain;
Content-Transfer-Encoding: 7bit;
Content-Disposition: inline;

!-- Sample footer note --! 
------=_20160127171644_62291--

但是当我更新电子邮件正文时,Outlook 会将示例注释视为附件。如果是 Thunderbird,当我点击转发电子邮件时,它会将页脚视为附件。

所以我的问题是,在电子邮件中添加页脚文本的最佳方法是什么? 我做得对吗?如果有任何问题,建议更改/指出。

【问题讨论】:

    标签: email outlook footer mime mime-mail


    【解决方案1】:

    您的邮件的 MIME 结构有误。应该是

    multipart/mixed
        multipart/alternative
            text/plain
            text/html
        application/octet-stream
    

    【讨论】:

      猜你喜欢
      • 2014-11-22
      • 2010-10-21
      • 2011-08-25
      • 2017-06-20
      • 1970-01-01
      • 2016-06-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多