Skip to main content

Posts

Showing posts from May, 2008

Email messages with embedded images

Finally stumbled upon the way to create email messages with embedded images in ASP.NET 2.0. (Note that this doesn't work for ASP.NET 1.1, sorry to say.) For review ... you can add an image to an email message in these ways: * Attach it. Works ok, but it's ... attached. Illustrated earlier. * In an HTML-formatted message, create an tag that points to an absolute URL. * In an HTML-formatted message, create an tag that points to an embedded image and then (duh) embed the image. In that case, the image shows up inline with the message's text. Pointing to an absolute URL keeps the message size down, but you have no control over the image on the server, and it could go away or change. Attaching and embedding keep a copy of the image with the message, but bloat the message size. So, embedding. The trick, such as it is, is to create an alternative view and to add a linked resource to the alternative view. Alternative views enable you to create different versions of th