如何在 CRM2011 中引用 html 电子邮件正文中的附加图像
我想创建一封包含 CRM2011 插件中嵌入图像的电子邮件。 因此计划是创建一个电子邮件实体,向其中添加一个附件实体,并在电子邮件 html 正文中包含如下所示的图像元素:
<img src="cid:[email protected]" />
问题是我不知道 CRM2011 是如何生成 content-id 的。
第一部分 (image001.png
) 显然是附件的文件名。但是另一部分(@01CBDDB1.BACB59F0
)来自哪里?有没有办法根据附件实体的字段导出这部分?
干杯, 馕。
I would like to create an email with an embedded image from within a CRM2011 plug-in.
So the plan is to create an email entity, add an attachment entity to it and include an image element like the following in the email html body:
<img src="cid:[email protected]" />
The problem is that I do not know how the content-id is generated by CRM2011.
The first part (image001.png
) is obviously the file name of the attachment. But where does the other part (@01CBDDB1.BACB59F0
) come from? Is there a way to derrive this part based on the fields of the attachment entity?
Cheers,
Nang.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
查看发送到电子邮件客户端的原始 MIME,当电子邮件路由器将附件添加到电子邮件时,没有指定 ContentID,并且我无法看到通过 SDK ActivityMimeAttachment 添加附件。
如果您编写服务器代码,我能想到的唯一选择是将电子邮件直接发送到您的 SMTP 服务器,这样您就可以为附件添加内容 ID 并在图像中引用它们。您可以使用 OpenPop 来中继消息。
我尝试过的另一种选择是将图像作为数据嵌入到 img 标签中,并以 base64 编码。虽然此方法有效,但在查看邮件时,Mac 和 Windows 版 Outlook 似乎无法正确呈现图像。如果您在浏览器中单击查看消息,则 html 消息会在浏览器中正确显示。但这并没有多大用处。
http://en.wikipedia.org/wiki/Data_URI_scheme#Web_browser_support
Looking at the raw MIME that is delivered to the email client, when the attachments are added to the email by the email router there is no ContentID specified and I can't see anyway of adding one through the SDK ActivityMimeAttachment.
The only alternative I can think of, if your writing server code, is to send the email directly to your SMTP server, that way you can add your content id for your attachments and reference them in the image. You could use OpenPop to relay the message.
Another alternative I've tried is to embed the image as data in the img tag as base64encoded. While this works, it seems that Outlook for the mac and windows does not render the image correctly when view the message. If you view click the view message in browser, html message displayed correctly in the browser. But that's not a lot of use.
http://en.wikipedia.org/wiki/Data_URI_scheme#Web_browser_support