title: BizTalk SMTP Message Part Getting XML Encoding
body: <p>I have a email multi-part message which I am using to send failed message routing from the messagebox to a business users mailbox.</p>
  
  <pre><code>Email{ Body - RawString; OriginalMessage - string};
  </code></pre>
  
  <p>The original message gets set from the received message that activates the orchestration. For example assume the original failed message is from a Flat file that failed disassembly with the contents:</p>
  
  <pre><code>Order,1,2,3,4,5,&lt;6&gt;,
  </code></pre>
  
  <p>I set the message using:</p>
  
  <pre><code>Email.OriginalMessage = MyUtil.XlangMsgToStringMethod(FailedMessage);// XmlDocument type, this can be malformed xml, valid xml, or flat file that fails in disassembler.
  </code></pre>
  
  <p>I can then write to the event log to test whats in Email.OriginalMessage:</p>
  
  <p>System.Diagnostics.EventLog.WriteEntry("BizTalk Server 2006", Email.OriginalMessage, Information); // This displays the correct original message "Order, 1,2,3,4,5,&lt;6>,"</p>
  
  <p><strong>When the email is delivered using a SMTP server and a dynamic send port, with the attachment set to text/plain mime type, the original message gets xml encoding escaped and wrapped in xml:</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;string&gt;Order, 1,2,3,4,5,&amp;lt;6&amp;gt;,&lt;/string&gt;
  </code></pre>
  
  <p><strong>Any ideas why? The SMTP port has passthrutransmit as pipeline.</strong></p>
  
  <p>Thanks.</p>