Here is the background: the images in HTML e-mail should be referenced using the special
URI scheme "
cid:
" (Content-id). Please see:
http://en.wikipedia.org/wiki/URI_scheme[
^],
http://tools.ietf.org/html/rfc2392[
^].
The e-mail should be a multipart e-mail. Some parts could be HTML documents and some — base64-encoded images. To reference an image in one part in HTML part, HTML code <
img
> tag should reference the image as
cid:<content-id></content-id>
, where
content-id
should be the same as
LinkedResource.ContentId
of the image part to be referenced and thus rendered as inserted in HTML document.
This example illustrates using this technique for creation of e-mail with C# and .NET:
http://kosiara87.blogspot.com/2011/04/c-sending-mail-with-embedded-image.html[
^].
(This is a pretty dumb code; it uses a placeholder "@@IMAGE@@"
in the HTML code to be replaced with actual value for content id using string.Replace
, instead of, say, using string.Format
. It has nothing to do with the idea of embedding the images.)I found this example using this query:
http://bit.ly/zpvER5[
^].
If you need more advanced example, try to find some more; it returned just about 227,000 results.
—SA