Note that there are some explanatory texts on larger screens.

plurals
  1. POMultipart HTML and embedded images from .NET without disk access?
    text
    copied!<p>I'm working on a product that creates MS Word output by generating an HTML document with the appropriate bits of Word CSS and XML magic embedded in it. I now need to embed RTF (images and styled text) in the document, and so am looking at the multipart HTML generation features in .NET.</p> <p>I'd like to generate the MHTML document by converting the RTF snippets into images in memory, and then just embedding the Base64-encoded data directly into the MHTML object. So far, I can't find any .NET solutions to do that. </p> <p>The <a href="http://msdn.microsoft.com/en-us/library/ms526266(EXCHG.10).aspx" rel="nofollow noreferrer">MS CDO stuff</a> is promising, but it looks like the only way to create an attachment is to provide a URL to the data and use <a href="http://msdn.microsoft.com/en-us/library/ms526569(EXCHG.10).aspx" rel="nofollow noreferrer">AddRelatedBodyPart()</a> to add it to the object.</p> <p>The System.Net.Mail package also looks compelling (as documented <a href="http://www.fuzzydev.com/blogs/dotnet/archive/2006/07/23/System_Net_Mail_AlternateView_LinkedResource.aspx" rel="nofollow noreferrer">here</a> and in a previous question <a href="https://stackoverflow.com/questions/104177/how-do-i-embed-an-image-in-a-net-html-mail-message">here</a>), but I don't see a straightforward way to convert the generated mail object to a string -- the API seems to be focused around sending mail messages, not generating files.</p> <p>Right now, I'm pushing forward with an approach that uses CDO and temporary directories, but I'm unhappy with that as a long-term approach. Any better suggestions?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload