Biztalk Server 2006 HTML Email with inline images

Home Page Forums BizTalk 2004 – BizTalk 2010 Biztalk Server 2006 HTML Email with inline images

Viewing 1 reply thread
  • Author
    Posts
    • #24218

      Dear all

      I m quite new in Biztalk Server 2006 and I have a problem regarding
      sending HTML Email with inline images. What I have do so far is sending
      HTML emails (or text emails) in BizTalk without embedded images which
      works.

      Could somebody help me with this?
      Thank you very much for your efforts!

      Br, Toan

    • #24220

      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();
      }}}}

      • #24223

        Hi Greg

        Could you please tell me in which file I should put your code? In orchestration xxx.odx.cs file or somewhere else? And also where do I need to call the AttachImage function?

        Thank you very much.

        Br, Toan

Viewing 1 reply thread
  • The forum ‘BizTalk 2004 – BizTalk 2010’ is closed to new topics and replies.