none
Saving a draft message with inline attachments RRS feed

  • Question

  • I'm using exchange 2010, outlook 2010.
    My Goal: to save a message from a template defined in my web application to the user's draft folder.
    What i do:
    EmailMessage msg = new EmailMessage(service);
    msg.Body =new MessageBody (Exchange.BodyType.HTML, @"<img width=100 height=100 id=""1"" src=""test.png"">");
    //.....
    msg.Attachments.AddFileAttachment("test.png", @"C:\test.png");
    msg.Attachments[0].IsInline = true;
    msg.Save(Exchange.WellKnownFolderName.Drafts);
    The results: the message is displayed, but the inline attachment doesn't. If i use msg.SendAndSaveCopy() instead of msg.Save, inline attachments display fine, but i don't need to send the message.
    The question: is there a way to save a message with inline attachments in a draft folder without sending it? Why .Save method doesn't work with inline attachments?

    • Edited by serj965 Monday, December 19, 2011 1:57 PM
    Thursday, December 15, 2011 9:43 PM

All replies

  • Still didn't find the solution, please advice me where to go and ask such a question, any support or something else.

    Monday, December 19, 2011 2:00 PM
  • Try adding a placeholder somewhere in the body text:

    "<img src=""cid:" + msg.Attachments[0].ContentId + """>"

    It works okay here.


    Mobile OWA For Smartphone
    www.leederbyshire.com
    email a@t leederbyshire d.0.t c.0.m
    Wednesday, December 21, 2011 5:06 PM