HTMLMailer embedded images (image content Id's)

Does HTMLMailer support embedded images?

Date Entered: 09/26/2007    Last Updated: 09/26/2007

The HTMLMailer component does support embedded images. By default, the ParseHTML property is true, which means when you set the MessageHTML property to a string value that contains a valid image tag, the component will automatically generate the CID and embed the image in the message it sends.

If you need to customize this, you can do so by setting ParseHTML to false and manually adding the image to the component's Images collection. For example:

htmlmailer1.ParseHTML = false; htmlmailer1.MessageHTML = "<html><body><h1>hello</h1><img src='cid:1444'></img><h2>good bye</h2></body></html>"; HTMLImage myImage = new HTMLImage("testimage.bmp"); myImage.Id = "1444"; myImage.ImageType = "image/bmp"; htmlmailer1.Images.Add(myImage); htmlmailer1.Send();

We appreciate your feedback.  If you have any questions, comments, or suggestions about this entry please contact our support team at kb@nsoftware.com.