-->

How to Embed Image in Outlook Signature?

2020-08-10 08:42发布

问题:

Is it possible to create an HTML email signature for Outlook 2003 or above that doesn't reference external images?

That is, using those special "cid" reference but embed the image itself in the signature and not on the file system or network.

This is for an web application that generates a "standard" email signature based on various input from a user. It has worked fine so far with a single "embedded" image. But a new feature is going to require the possible addition of multiple tiny images.

Getting to user to save one email signature template and one image to the user's machine is about the limit of what I'd like to require of the user. But forcing the user to save multiple images seem to be pushing things a little to far in my opinion.

So my problem is trying to embed the images into without having to inconvenience the user with multiple downloads first.

回答1:

If you reference the image using a file:/// URI Outlook will automatically change it into a cid: URI and add the image as an attachment on insertion.

BTW: What has this got to do with programming?

EDIT: OK, considering your update to the question: I'm afraid this isn't possible. It's not a limitation specific to signatures or Outlook though. It's just the way HTML works. If you want images inside an HTML document these will have to be separate. No way around that without proprietary formats, none of which Outlook would accept as a signature.

However, if this is for an intranet application you can get away with placing the images on a network share and referencing via UNC, e.g.

<img src="file://///ServerName/ShareName/FileName.png" />


回答2:

Is it possible to base64 encode the image?

<a href="http://www.britblog.com/">
    <img
        src="data:image/gif;base64,R0lGODlhUAAPAKIAAAsLav///88PD9WqsYmApmZmZtZfYmdakyH5BAQUAP8ALAAAAABQAA8AAAPbWLrc/jDKSVe4OOvNu/9gqA /..../NcV9/j5+g4JADs="
        alt="Signature" width="80" height="15">
</a>

Just a thought



回答3:

If the image is small enough, then you might be able to do something with a data URI.



回答4:

The way for all outlook version

Just write your .html with img file on the same directory, open it with chrome, select and copy the signature. Open Outlook and go to new post => signatures => new signature => name it Paste your signature on the field and press SAVE. Job is done.

PS : Remember to use ONLY table, tr, td, img, a tags to avoid problems with outlook. Never use p div tags.