Hi,

 

http://social.msdn.microsoft.com/Forums/zh-TW/6c063b27-7e8a-4963-ad5f-ce7e5ffb2c64/how-to-embed-image-in-html-body-in-c-into-outlook-mail

If you make add-in for Outlook 2007 or higher try to add the following code before newMail.Send():

   Attachment attachment = newMail.Attachments.Add(
     @"E:\Pictures\image001.jpg"
    , OlAttachmentType.olEmbeddeditem
    , null
    , "Some image display name"
    );

   string imageCid = "image001.jpg@123";

   attachment.PropertyAccessor.SetProperty(
     "http://schemas.microsoft.com/mapi/proptag/0x3712001E"
    , imageCid
    );

   newMail.HTMLBody = String.Format(
     "<body><img src=\"cid:{0}\"></body>"
    , imageCid
    );

Of course you can insert the tag "img" in the existing html body instead of override it like in my example.

 

相关文章:

  • 2021-07-12
  • 2022-01-28
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
猜你喜欢
  • 2022-01-09
  • 2021-12-20
  • 2021-09-26
  • 2021-12-26
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案