title: Send already generated MHTML using CDOSYS through C#?
body: <p>I have a ready generated MHTML as a byte array (from Aspose.Words) and would like to send it as an email. I'm trying to do this through CDOSYS, though am open to other suggestions. For now though I have the following:</p>
  
  <pre><code>        CDO.Message oMsg = new CDO.Message();
          CDO.IConfiguration iConfg = oMsg.Configuration;
          Fields oFields = iConfg.Fields;
  
          // Set configuration.
          Field oField = oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"];
          oField.Value = CDO.CdoSendUsing.cdoSendUsingPort;
          oField = oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"];
          oField.Value = SmtpClient.Host;
          oField = oFields["http://schemas.microsoft.com/cdo/configuration/smtpserverport"];
          oField.Value = SmtpClient.Port;
          oFields.Update();
  
          //oMsg.CreateMHTMLBody("http://www.microsoft.com", CDO.CdoMHTMLFlags.cdoSuppressNone,  "", "");
          // NEED MAGIC HERE :)
          oMsg.Subject = warning.Subject;             // string
  
          oMsg.From = "system@example.com";
          oMsg.To = warning.EmailAddress;
          oMsg.Send();
  </code></pre>
  
  <p>In this snippet, the warning variable has a Body property which is a byte[].  Where it says "NEED MAGIC HERE" in the code above I want to use this byte[] to set the body of the CDO Message.  </p>
  
  <p>I have tried the following, which unsurprisingly doesn't work:</p>
  
  <pre><code>oMsg.HTMLBody = System.Text.Encoding.ASCII.GetString(warning.Body);
  </code></pre>
  
  <p>Anybody have any ideas how I can achieve what I want with CDOSYS or something else?</p>