如何将图像嵌入到Outlook HTML电子邮件中? [英] How to embed an image into an Outlook HTML email message?

查看:579
本文介绍了如何将图像嵌入到Outlook HTML电子邮件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个Winforms应用程序,它支持将HTML的大块内容拖放到Outlook(HTML)邮件中.

We have a Winforms application which supports dragging and dropping chunks of HTML into Outlook (HTML) mail messages.

大块的文字就可以了.

但是我们如何处理图像呢?假设我们不想在线托管图像,而是希望将其与电子邮件一起发送.还要假设我们确实希望以嵌入式方式查看图像,而不是以附件形式显示(当然,收件人的电子邮件客户端支持该图像).

But how do we proceed with images? Let's assume we don't want to host the images online but instead we want to send them with the email message. Assume also that we do want to see the image inline, not as an attachment (where the recipient's email client supports that, of course).

如果您查看Outlook消息的HTML源,那么图像会有"cid"标签(我猜是作为附件指向图像),但是我们如何生成cid/contentid?

If you look at the HTML source of an Outlook message there are "cid" tags for images (which point to the image as an attachment I guess), but how do we go about generating a cid/contentid?

推荐答案

如果可以选择在流程中进行手动操作,则可以这样操作:

If a manual step in the process is an option, you can do it like this:

  1. 使用链接到本地保存的图像文件
  2. <img>标签自动或手动将HTML创建为已保存的HTML文件. 在选择HTML文件作为附件时,使用"以文本形式插入"选项将 HTML附加到Outlook电子邮件中,该选项隐藏在插入"按钮的向下箭头下方.
  1. create the HTML automatically or manually as a saved HTML file, with <img> tags that link to locally-saved image files
  2. attach the HTML to an Outlook email using the 'Insert as text' option tucked away under the down-arrow on the "Insert" button when selecting the HTML file as an attachment.

这将使用文件中的HTML填充HTML电子邮件并嵌入所有图像.我相信该工具会使用Sam64电子邮件中所述的Base64编码来嵌入图像.

This populates the HTML email with the HTML from the file and embeds all images. I believe this tool uses Base64 encoding to embed the images as described in Sam's email.

根据工作流程,此方法可能比将图像自己转换为Base64容易.

Depending on the workflow, this method might be easier than converting images to Base64 yourself.

请注意,此方法仅适用于Windows的Outlook,不是Outlook for Mac .

这篇关于如何将图像嵌入到Outlook HTML电子邮件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆