none
When send email using EWS, some tags in html body are removed. How to solve it? RRS feed

  • Question

  • I send a email using EWS.

    Body is a html and has some tags as see below

    <object .....>
      <param .../>
      <param .../>
    </object>

    When message is sent, param tags are removed. Content of email has only <object ...></object>

    But email using SMTP is sent successfully.

    What's wrong? How to solve it?

    Tuesday, January 11, 2011 6:39 AM

Answers

  • windria,

    Our forum is for the support of the Open Specifications Documentation . After a thorough review of your issue, I have concluded that your question does not address the contents in the published documentation set (the protocol details itself --> [MS-OXWSMSG] ). However, after reviewing your log I can inform you that the XML structure detailing the CreateItem operation seems valid upon my observation and a status of 200 does indeed indicate success of the operation. However, asking your question again in the Exchange Development Forum will probably yield you the answer you are seeking.

    Thank you.

    Dominic Salemno
    Escalation Engineer
    Open Specifications

     

    • Marked as answer by King Salemno Tuesday, January 18, 2011 6:47 AM
    • Unmarked as answer by windria Tuesday, January 18, 2011 7:50 AM
    • Marked as answer by windria Tuesday, January 18, 2011 7:50 AM
    Tuesday, January 18, 2011 6:47 AM

All replies

  • Hi Windria, thank you for your question. A member of the protocol documentation team will respond to you soon.
    Josh Curry (jcurry) | Escalation Engineer | US-CSS DSC Protocols Team
    Tuesday, January 11, 2011 10:22 PM
    Moderator
  • windria,

    I am the engineer who has taken ownership of your issue. I am currently investigating this matter and will update you as things progress.

    Dominic Salemno
    Escalation Engineer
    Open Specifications

    Wednesday, January 12, 2011 6:40 PM
  • I am having the same problem (C#, .NET 4, EWS 1.1).

    If I look at the source of the message I see that in fact it is not MIME multipart and it has no HTML section, the message is in the plain text section with all of the HTML code stripped out.

    My code is very simple, straight from the MSDN samples but I get no HTML...

    NewMessage.Subject = "Test HTML Message";
    NewMessage.Body = "<!doctype html><html><head></head><body>This is a <b>Test</b> message.<br><br>Tony</body></html>";
    NewMessage.Body.BodyType = BodyType.HTML;
    NewMessage.ToRecipients.Add("me@myserver.com");
    NewMessage.SendAndSaveCopy();
    
    
    When the message comes it looks like this...

     

    Content-Type: text/plain; charset="us-ascii"
    Content-Transfer-Encoding: quoted-printable
    MIME-Version: 1.0
    X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2010122901)]
    X-MAIL-FROM: <planit@denverzoo.org>
    X-SOURCE-IP: [67.136.148.58]
    X-AnalysisOut: [v=1.0 c=1 a=HLnArrzbAHQA:10 a=BLceEmwcHowA:10 a=kj9zAlcOel]
    X-AnalysisOut: [0A:10 a=xqWC_Br6kY4A:10 a=ERe/uVw5acJt2lgRGY+7Og==:17 a=kf]
    X-AnalysisOut: [gQ0OFIQbBocxoMlqUA:9 a=38cltaETFIW79hlmDDAT2RvU_hAA:4 a=Cj]
    X-AnalysisOut: [uIK1q_8ugA:10]
    
    This is a Test message.
    
    Tony

    Wednesday, January 12, 2011 10:17 PM
  • Additionally, problem is also occurred when gets a message using EWS

    Param tags are stripped in getting message.

    I received messages through POP3 program

    Received message is

    <object ....>
      <param .../>
      <param .../>
    </object>

    But getting message using EWS is

    <object ...></object>

    My development enviroment is
      .Net Framework 4.0
       EWS 1.1
      Exchange Server 2010 SP1

    • Edited by windria Thursday, January 13, 2011 2:07 AM Adds a dev enviroment
    Thursday, January 13, 2011 2:05 AM
  • Perhaps you could check what is going over the wire (using netmon or wireshark) and comparing that to what you are writing in your IDE?
    Thursday, January 13, 2011 3:56 AM
  • With further research I suspect that there is some Transport setting in the Exchange server that is stripping the HTML. I just can't figure out what setting is.
    Tony Niemann www.zierniemann.com
    Thursday, January 13, 2011 7:04 PM
  • Noting Brad's Post.

    If you both have Network Monitor or WireShark captures you could provide to me at dochelp [at] microsoft.com that would be much appreciated. It's not necessary but assists me in reproducing the scenario.

    Dominic Salemno
    Escalation Engineer
    Open Specifications

    Friday, January 14, 2011 3:15 PM
  • I can capture the transmission from the application to the exchange server with wireshark, but it is a secure server so the message is encrypted...
    Tony Niemann www.zierniemann.com
    Friday, January 14, 2011 5:40 PM
  • You can either disable encryption (there is guidance on how to do this in http://support.microsoft.com/kb/2006508 ) or extract the server keytab and use that in wireshark (http://wiki.wireshark.org/Kerberos) to decrypt the traffic.

    Brad

     

     

    Friday, January 14, 2011 9:26 PM
  • Logs are below ( captured by Fiddler )
    And I found some cases that tags are removed or not

    If a body contains Korean, <param/> tag are removed.

    <p>음성 메일입니다.</p>
    <OBJECT ID="WMP" WIDTH="170" height="70"
      CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"
      STANDBY="Now loading..."
      TYPE="application/x-oleobject" VIEWASTEXT align=middle>
      <PARAM NAME="FileName" VALUE="http://192.168.137.1117/test.wav">
      <PARAM NAME="ShowPositionControls" VALUE="False">
      <PARAM NAME="ShowControls" VALUE="True">
      <PARAM NAME="AutoRewind" VALUE="True">
      <PARAM NAME="AutoStart" VALUE="True">
      <PARAM NAME="ShowDisplay" VALUE="False">
      <PARAM NAME="ShowStatusBar" VALUE="True">
      <PARAM NAME="ShowTracker" VALUE="True">
    </OBJECT>

    But body only contains tags, <param/> tags are preserved

    <OBJECT ID="WMP" WIDTH="170" height="70"
      CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95"
      STANDBY="Now loading..."
      TYPE="application/x-oleobject" VIEWASTEXT align=middle>
      <PARAM NAME="FileName" VALUE="http://192.168.137.1117/test.wav">
      <PARAM NAME="ShowPositionControls" VALUE="False">
      <PARAM NAME="ShowControls" VALUE="True">
      <PARAM NAME="AutoRewind" VALUE="True">
      <PARAM NAME="AutoStart" VALUE="True">
      <PARAM NAME="ShowDisplay" VALUE="False">
      <PARAM NAME="ShowStatusBar" VALUE="True">
      <PARAM NAME="ShowTracker" VALUE="True">
    </OBJECT>

    Same problem is occured when get a message
    I make two mail.
    One is containing Korean, other is not.
    Gets a mail contains Korean, param tags are removed. Other mail is not.

    =========================== Logs captured by Fiddler =================================

    POST http://192.168.137.117/EWS/exchange.asmx HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    Accept: text/xml
    User-Agent: ExchangeServicesClient/14.02.0051.000
    Accept-Encoding: gzip,deflate
    Host: 192.168.137.117
    Content-Length: 1832
    Expect: 100-continue
    Connection: Keep-Alive

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Header>
        <t:RequestServerVersion Version="Exchange2010_SP1" />
      </soap:Header>
      <soap:Body>
        <m:CreateItem MessageDisposition="SendAndSaveCopy">
          <m:SavedItemFolderId>
            <t:DistinguishedFolderId Id="sentitems" />
          </m:SavedItemFolderId>
          <m:Items>
            <t:Message>
              <t:Subject>This is a test mail</t:Subject>
              <t:Body BodyType="HTML">&lt;p&gt;음성 메일입니다.&lt;/p&gt;&lt;OBJECT ID="WMP" WIDTH="170" height="70" CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Now loading..." TYPE="application/x-oleobject" VIEWASTEXT align=middle&gt; &lt;PARAM NAME="FileName" VALUE="http://192.168.137.117/test.wav"&gt; &lt;PARAM NAME="ShowPositionControls" VALUE="False"&gt; &lt;PARAM NAME="ShowControls" VALUE="True"&gt; &lt;PARAM NAME="AutoRewind" VALUE="True"&gt; &lt;PARAM NAME="AutoStart" VALUE="True"&gt; &lt;PARAM NAME="ShowDisplay" VALUE="False"&gt; &lt;PARAM NAME="ShowStatusBar" VALUE="True"&gt; &lt;PARAM NAME="ShowTracker" VALUE="True"&gt; &lt;/OBJECT&gt;</t:Body>
              <t:ToRecipients>
                <t:Mailbox>
                  <t:EmailAddress>windria@lycos.co.kr</t:EmailAddress>
                </t:Mailbox>
              </t:ToRecipients>
              <t:From>
                <t:Mailbox>
                  <t:Name>windria</t:Name>
                  <t:EmailAddress>windria@vmserver.co.kr</t:EmailAddress>
                </t:Mailbox>
              </t:From>
            </t:Message>
          </m:Items>
        </m:CreateItem>
      </soap:Body>
    </soap:Envelope>

    HTTP/1.1 401 Unauthorized
    Server: Microsoft-IIS/7.5
    Set-Cookie: exchangecookie=51fda0713c454f6fac8398a0a214c4cc; expires=Sun, 15-Jan-2012 05:25:32 GMT; path=/; HttpOnly
    WWW-Authenticate: Negotiate
    WWW-Authenticate: NTLM
    X-Powered-By: ASP.NET
    Date: Sat, 15 Jan 2011 05:25:32 GMT
    Content-Length: 0
    Proxy-Support: Session-Based-Authentication

     

    ------------------------------------------------------------------

    POST http://192.168.137.117/EWS/exchange.asmx HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    Accept: text/xml
    User-Agent: ExchangeServicesClient/14.02.0051.000
    Accept-Encoding: gzip,deflate
    Authorization: Negotiate TlRMTVNTUAABAAAAl4II4gAAAAAAAAAAAAAAAAAAAAAGAbAdAAAADw==
    Host: 192.168.137.117
    Cookie: exchangecookie=51fda0713c454f6fac8398a0a214c4cc
    Content-Length: 0


    HTTP/1.1 401 Unauthorized
    Server: Microsoft-IIS/7.5
    WWW-Authenticate: Negotiate TlRMTVNTUAACAAAAEAAQADgAAAAVgonieBnxk0DlVCkAAAAAAAAAAMYAxgBIAAAABgGwHQAAAA9WAE0AUwBFAFIAVgBFAFIAAgAQAFYATQBTAEUAUgBWAEUAUgABAB4AVwBJAE4ALQBGADUAVABLADkAVQAxAE0AOQA5AE4ABAAcAHYAbQBzAGUAcgB2AGUAcgAuAGMAbwAuAGsAcgADADwAVwBJAE4ALQBGADUAVABLADkAVQAxAE0AOQA5AE4ALgB2AG0AcwBlAHIAdgBlAHIALgBjAG8ALgBrAHIABQAcAHYAbQBzAGUAcgB2AGUAcgAuAGMAbwAuAGsAcgAHAAgAtLL8oHS0ywEAAAAA
    WWW-Authenticate: NTLM
    X-Powered-By: ASP.NET
    Date: Sat, 15 Jan 2011 05:25:32 GMT
    Content-Length: 0
    Proxy-Support: Session-Based-Authentication

     

    ------------------------------------------------------------------

    POST http://192.168.137.117/EWS/exchange.asmx HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    Accept: text/xml
    User-Agent: ExchangeServicesClient/14.02.0051.000
    Accept-Encoding: gzip,deflate
    Authorization: Negotiate TlRMTVNTUAADAAAAGAAYAJYAAAB2AXYBrgAAABwAHABYAAAADgAOAHQAAAAUABQAggAAABAAEAAkAgAAFYKI4gYBsB0AAAAP8Q3o91X8I7OBICiuSwtiBXYAbQBzAGUAcgB2AGUAcgAuAGMAbwAuAGsAcgB3AGkAbgBkAHIAaQBhAFcASQBOAEQAUgBJAEEALQBOAEIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcrrnTMUcWd0RfRnfbhbaGwEBAAAAAAAAtLL8oHS0ywHatAOo2Sq13gAAAAACABAAVgBNAFMARQBSAFYARQBSAAEAHgBXAEkATgAtAEYANQBUAEsAOQBVADEATQA5ADkATgAEABwAdgBtAHMAZQByAHYAZQByAC4AYwBvAC4AawByAAMAPABXAEkATgAtAEYANQBUAEsAOQBVADEATQA5ADkATgAuAHYAbQBzAGUAcgB2AGUAcgAuAGMAbwAuAGsAcgAFABwAdgBtAHMAZQByAHYAZQByAC4AYwBvAC4AawByAAcACAC0svygdLTLAQYABAACAAAACAAwADAAAAAAAAAAAAAAAAAwAACEVF2VX9KeAo7K//PpLGZNaSQ2Gp8WpXDL0jcwIVYq/woAEAAAAAAAAAAAAAAAAAAAAAAACQAoAEgAVABUAFAALwAxADkAMgAuADEANgA4AC4AMQAzADcALgAxADEANwAAAAAAAAAAAAAAAADSaqGYWkoLtOYd8rH6dsWT
    Host: 192.168.137.117
    Cookie: exchangecookie=51fda0713c454f6fac8398a0a214c4cc
    Content-Length: 1832
    Expect: 100-continue

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Header>
        <t:RequestServerVersion Version="Exchange2010_SP1" />
      </soap:Header>
      <soap:Body>
        <m:CreateItem MessageDisposition="SendAndSaveCopy">
          <m:SavedItemFolderId>
            <t:DistinguishedFolderId Id="sentitems" />
          </m:SavedItemFolderId>
          <m:Items>
            <t:Message>
              <t:Subject>This is a test mail</t:Subject>
              <t:Body BodyType="HTML">&lt;p&gt;음성 메일입니다.&lt;/p&gt;&lt;OBJECT ID="WMP" WIDTH="170" height="70" CLASSID="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" STANDBY="Now loading..." TYPE="application/x-oleobject" VIEWASTEXT align=middle&gt; &lt;PARAM NAME="FileName" VALUE="http://192.168.137.117/test.wav"&gt; &lt;PARAM NAME="ShowPositionControls" VALUE="False"&gt; &lt;PARAM NAME="ShowControls" VALUE="True"&gt; &lt;PARAM NAME="AutoRewind" VALUE="True"&gt; &lt;PARAM NAME="AutoStart" VALUE="True"&gt; &lt;PARAM NAME="ShowDisplay" VALUE="False"&gt; &lt;PARAM NAME="ShowStatusBar" VALUE="True"&gt; &lt;PARAM NAME="ShowTracker" VALUE="True"&gt; &lt;/OBJECT&gt;</t:Body>
              <t:ToRecipients>
                <t:Mailbox>
                  <t:EmailAddress>windria@lycos.co.kr</t:EmailAddress>
                </t:Mailbox>
              </t:ToRecipients>
              <t:From>
                <t:Mailbox>
                  <t:Name>windria</t:Name>
                  <t:EmailAddress>windria@vmserver.co.kr</t:EmailAddress>
                </t:Mailbox>
              </t:From>
            </t:Message>
          </m:Items>
        </m:CreateItem>
      </soap:Body>
    </soap:Envelope>

    HTTP/1.1 200 OK
    Cache-Control: private
    Transfer-Encoding: chunked
    Content-Type: text/xml; charset=utf-8
    Content-Encoding: gzip
    Vary: Accept-Encoding
    Server: Microsoft-IIS/7.5
    X-EwsPerformanceData: RpcC=3;RpcL=62;LdapC=0;LdapL=0;
    X-AspNet-Version: 2.0.50727
    Persistent-Auth: true
    X-Powered-By: ASP.NET
    Date: Sat, 15 Jan 2011 05:25:32 GMT

    1cc
    �      �`I�%&/m�{J�J��t��`$ؐ@������iG#)�*��eVe]f@�흼��{���{���;�N'���?\fdl��J�ɞ!���?~|?"��ez��MQ-?�hw��Q�/�լX^|�Ѻ=�>���8z�<:]^�e��Sj�l5�}4o�գ�w��<_d͘>o�l5�ꋻ��n�o���;�fy}�x��u^S?)]�-ϫ��+���Q�E��?�H�<Y���z1���>��=�v��x۾x�n:ϖ��������%���=�Ŵ���O���\߻���4o����|z��^���p��5��ruu5���ģ��w�/��f��Ųi��4wo�n~룻G��:�7��T��B�G��N�<k�6_�ʛU�l �,��y�d�l��#���/pi�65��YC��z=%�!��j���N뺪��|N� ���l����a}�
    8
    s��I6�
    c
    y�� f+�� 
    0

     

    ------------------------------------------------------------------

     

    Saturday, January 15, 2011 6:15 AM
  • windria,

    Our forum is for the support of the Open Specifications Documentation . After a thorough review of your issue, I have concluded that your question does not address the contents in the published documentation set (the protocol details itself --> [MS-OXWSMSG] ). However, after reviewing your log I can inform you that the XML structure detailing the CreateItem operation seems valid upon my observation and a status of 200 does indeed indicate success of the operation. However, asking your question again in the Exchange Development Forum will probably yield you the answer you are seeking.

    Thank you.

    Dominic Salemno
    Escalation Engineer
    Open Specifications

     

    • Marked as answer by King Salemno Tuesday, January 18, 2011 6:47 AM
    • Unmarked as answer by windria Tuesday, January 18, 2011 7:50 AM
    • Marked as answer by windria Tuesday, January 18, 2011 7:50 AM
    Tuesday, January 18, 2011 6:47 AM