邮件RFC嵌入图像使用cid for text / plain

时间:2018-02-06 10:31:03

标签: image email mime-message

虽然我记得电子邮件可能包含HTML和纯文本的嵌入图像,但我今天注意到Outlook 2013和Windows 10 Mail应用程序都没有显示它。

RFC标准是否删除了“[cid:]”定义?

以下是格式化的邮件: (另存为* .eml以显示其内容)

MIME-Version: 1.0
Date: Tue, 6 Feb 2018 10:12:53 +0100
From: Test User 2 <test.user2@lab.local>
Subject: TEst in plain text
Thread-Topic: TEst in plain text
To: Test User 1 <test.user1@lab.local>
Content-Type: multipart/mixed;
    boundary="_60A9E784-DBBE-4378-9A84-01D36C2226AF_"

--_60A9E784-DBBE-4378-9A84-01D36C2226AF_
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset="utf-8"

test

[cid:BBCLOGO@23AD2D600E]


--_60A9E784-DBBE-4378-9A84-01D36C2226AF_
Content-Type: image/jpg; name="23AD2D600EF4C69FF4D5479A8BB7FE73.jpg"
Content-ID: <BBCLOGO@23AD2D600E>
Content-Transfer-Encoding: base64
Content-Disposition: inline;
    filename="23AD2D600EF4C69FF4D5479A8BB7FE73.jpg"

/9j/4AAQSkZJRgABAgAAZABkAAD/2wBDAAIBAQEBAQIBAQIDAgECAwMCAgICAwMDAwMDAwMFAwQE
BAQDBQUFBgYGBQUHBwgIBwcKCgoKCgwMDAwMDAwMDAz/2wBDAQICAgQDBAcFBQcKCAcICgwMDAwM
DAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAz/wAARCAAyADIDAREA
AhEBAxEB/8QAHAAAAgIDAQEAAAAAAAAAAAAAAAcFCAIEBgMJ/8QAOBAAAQIFAQYBBw0BAAAAAAAA
AQIDAAQFBhETBwgSITFRQTQ1QmFicYEUFiIyMzZDY3KEkZSh8P/EABoBAAIDAQEAAAAAAAAAAAAA
AAAFAgMEBgH/xAAnEQACAgECBQMFAAAAAAAAAAAAAQIRAwQxBRIhUYEyQcEiYZHw8f/aAAwDAQAC
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BE-4378-9A84-01D36C2226AF_--

1 个答案:

答案 0 :(得分:1)

您指的是RFC 2387,&#34; MIME Multipart / Related Content-type&#34;

要通过其Content-ID(CID)MIME标头字段的值来引用附件,它就像以下一样简单:

<img src="cid:BBCLOGO@23AD2D600E">

请注意,您的正文必须是HTML,例如Content-Type: text/html; chaset="us-ascii",如RFC 2045 §5所示。

当您将图像放入邮件正文时,Outlook应自动执行此操作。如果您需要进一步的帮助配置,可能有一个比(以编程为中心)Stack Overflow更合适的Q&amp; A站点。