我遇到的问题与此处描述的问题类似:Body#setAsync munges value returned from Body#getAsync除了在Mac上的Outlook中,Body#getAsync
方法返回的图像带有本地file://
路径,而不是Content-ID
,因此我什至无法解决Body#setAsync
的重大号召。
这是Outlook for Mac v16.16(180726)的情况。
下面是一个简单的邮件正文示例,其中包含通过Body#getAsync
调用检索的嵌入式图像:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered)">
<style>
<!-- removed for brevity -->
</style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt">Text</span></p>
<p class="MsoNormal"><img width="128" height="128" style="width:1.3333in;height:1.3333in" id="Picture 1" src="~WRS%7b93C624AE-E366-7E4B-BB53-3C1C404687F1%7d.fld/image001.png"></p>
<p class="MsoNormal">More text</p>
<p class="MsoNormal"> </p>
</div>
</body>
请注意,在OWA或Windows版Outlook(以我为例,为16.0.9126.2259)中,图像正确返回了src
属性,该属性引用了文件的Content-ID
,如以下内容所示:
<head><meta name="ProgId" content="Word.Document"><meta name="Generator" content="Microsoft Word 15"><meta name="Originator" content="Microsoft Word 15"><link href="cid:filelist.xml@01D42E6E.032A2180" rel="File-List"><link href="cid:editdata.mso" rel="Edit-Time-Data"><!--[if !mso]>...<![endif]--><!--[if gte mso 9]>...<![endif]--><link href="~~themedata~~" rel="themeData"><link href="~~colorschememapping~~" rel="colorSchemeMapping"><!--[if gte mso 9]>...<![endif]--><!--[if gte mso 9]>...<![endif]--><style>...</style><!-- more style defs --></head><body lang="EN-US" style="tab-interval: .5in;" link="#0563c1" vlink="#954f72"><div class="WordSection1"><p class="MsoNormal">Foo<o:p></o:p></p><p class="MsoNormal"><span style="mso-no-proof: yes;"><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
<v:stroke joinstyle="miter" />
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0" />
<v:f eqn="sum @0 1 0" />
<v:f eqn="sum 0 0 @1" />
<v:f eqn="prod @2 1 2" />
<v:f eqn="prod @3 21600 pixelWidth" />
<v:f eqn="prod @3 21600 pixelHeight" />
<v:f eqn="sum @0 0 1" />
<v:f eqn="prod @6 1 2" />
<v:f eqn="prod @7 21600 pixelWidth" />
<v:f eqn="sum @8 21600 0" />
<v:f eqn="prod @7 21600 pixelHeight" />
<v:f eqn="sum @10 21600 0" />
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect" />
<o:lock v:ext="edit" aspectratio="t" />
</v:shapetype><v:shape id="Picture_x0020_1" o:spid="_x0000_i1025" type="#_x0000_t75" style='width:128.25pt;height:128.25pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="cid:image001.png@01D42E6E.032A2180" o:title="" />
</v:shape><![endif]--><!--[if !vml]--><img width="171" height="171" src="cid:image002.png@01D42E6E.032A2180" v:shapes="Picture_x0020_1"><!--[endif]--></span><o:p></o:p></p><p class="MsoNormal">Bar<o:p></o:p></p><p class="MsoNormal"><o:p> </o:p></p></div></body>
对我来说,这似乎是个错误。.我有办法使图像完整的身体吗?