Outlook 2013 rewrites html source when saving email

1

In our company we have a addin that saves emails and adds the email into the archive within that application. When using this plugin in combination with Outlook 2013 it sometimes removes all blank lines within the e-mail body.

When testing this I have noticed several things about when this happens:

  • These are all email that contain signatures.
  • The html source code starts with <html> instead of <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

I also noticed that this happens in specific cases. It does happen when:

  • The email is received as an attachement and shown as a preview
  • The email is received as an attachement and dragged to INBOX
  • Opening the email an running Save As

It does NOT happen when:

  • The email is received as an attachement and opened by double clicking
  • Opening the email and choosing move to folder (INBOX)
  • Doing the same actions in Outlook 2010

When comparing the two versions I can see that one of them is completely rewritten. These are the some differences in layout:

The good one:

  <body lang="NL" link="blue" vlink="purple">
    <div class="WordSection1">
      <p class="MsoNormal">
        <span style="color:#1F497D">Hoi Naam1,
        <o:p></o:p></span>
      </p>
      <p class="MsoNormal">
        <span style="color:#1F497D">
          <o:p>&#160;</o:p>
        </span>
      </p>
      <p class="MsoNormal">
        <span style="color:#1F497D">Heb gisteren Naam2 gemaild met onderstaande zaken, maar begreep dat hij op vakantie is. 
        <o:p></o:p></span>
      </p>
      <p class="MsoNormal">
        <span style="color:#1F497D">
          <o:p>&#160;</o:p>
        </span>
      </p>
      <p class="MsoNormal">
        <span style="color:#1F497D;mso-fareast-language:NL">Met vriendelijke groet,
        <o:p></o:p></span>
      </p>
      <p class="MsoNormal">
        <b>
          <span style="color:#1F497D;mso-fareast-language:NL">
            <o:p>&#160;</o:p>
          </span>
        </b>
      </p>
    </div>
  </body>

The bad one:

      <body lang="NL" link="blue" vlink="purple">
        <div class="WordSection1">
          <p class="MsoNormal">
            <span style="color:#1F497D">Hoi Naam1,
            <o:p></o:p>
            <p class="MsoNormal">
              <span style="color:#1F497D">
                <o:p></o:p>
                <p class="MsoNormal">
                  <span style="color:#1F497D">Heb gisteren Naam2 gemaild met onderstaande zaken, maar begreep dat hij op vakantie is. 
                  <o:p></o:p>
                  <p class="MsoNormal">
                    <span style="color:#1F497D">
                      <o:p></o:p>
                      <p class="MsoNormal">
                        <span style="color:#1F497D;mso-fareast-language:NL">Met vriendelijke groet,
                        <o:p></o:p>
                        <p class="MsoNormal">
                          <b>
                            <span style="color:#1F497D;mso-fareast-language:NL">
                              <o:p></o:p>
                            </span>
                          </b>
                        </p></span>
                      </p>
                    </span>
                  </p></span>
                </p>
              </span>
            </p></span>
          </p>
        </div>
      </body>

I do know that looking into fixing the signatures might fix this problem in a lot of cases. But we can't tell our customers to change their signatures so it will work for us.

Hopyfully you will be able to help us.

Best regards, Luc

Luc Verhoeven

Posted 2017-10-11T12:38:19.657

Reputation: 11

No answers