Home Page › Forums › BizTalk 2004 – BizTalk 2010 › Biztalk Server 2006 HTML Email with inline images › Re: Biztalk Server 2006 HTML Email with inline images
I briefly tried to get this to work, but failed. It should be possible.
Basically, you need to create a multipart message, with the your html body and the image as an attachment. The MIME encoder will create a mutlipart MIME message. The <img> src attribute in your html body should point to your attached image using the MIME Content Id property.
e.g. <img src=”cid:contentidentifier”/>
Here is some code I tried to use in a message assignment shape to add the image to the multipart message. This is the part that failed:
<
namespace Common
{
public class MessageHelper
{
public static void AttachImage(XLANGMessage message, string contentid)
{
try
{
IStreamFactory factory = new ImageStreamFactory(typeof(Common.MessageHelper).Assembly.GetManifestResourceStream “LesMills.Common.ErrorNotification.BizTalkServer2009.jpg”));
message.AddPart(factory, “image”);
message[“image”].SetPartProperty(typeof(MIME.ContentID), contentid);
}
finally //decrement refcount
{
message.Dispose();
}}}}