We are developing an add-in for the Outlook web app.
Using the UpdateItem operation we are able to set a mail item body (in read mode) via an EWS SOAP request using mailbox.makeEwsRequestAsync
.
Setting a mail item body is possible using plain Text
or HTML
.
However, when choosing HTML
, it is unclear:
- which tags are supported,
- if and what encoding needs to be used
We are using Angulars DomSanitizer.sanitize() to sanitize HTML before adding it to the SOAP body that is sent.
The request completes with statuscode 200
and ResponseCode NoError
.
Below is the copied request from Chrome DevTools, whereby only the Token
value was replaced.
{
"__type":"EwsProxyRequestParameters:#Exchange",
"Body":"<?xml version='1.0' encoding='utf-8'?>
<soap:Envelope
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:m='http://schemas.microsoft.com/exchange/services/2006/messages'
xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:t='http://schemas.microsoft.com/exchange/services/2006/types'>
<soap:Header>
<t:RequestServerVersion
Version='Exchange2013'
xmlns='http://schemas.microsoft.com/exchange/services/2006/types'
soap:mustUnderstand='0'/>
</soap:Header>
<soap:Body>
<UpdateItem MessageDisposition='SaveOnly' ConflictResolution='AutoResolve'
xmlns='http://schemas.microsoft.com/exchange/services/2006/messages'>
<ItemChanges>
<t:ItemChange>
<t:ItemId Id='AAMkAGMwZjFmZmM2LThiMjgtNGRmMS04MmU2LTVkMThkMzFiYzIyMQBGAAAAAACZUf7WM06iT6k1a2RX1stKBwB2lPdRh025RIK1EWGYTEUEAAAAAAEMAAB2lPdRh025RIK1EWGYTEUEAAGcC958AAA=' ChangeKey='CQAAABYAAAB2lPdRh025RIK1EWGYTEUEAAGcFNmY'/>
<t:Updates>
<t:SetItemField>
<t:FieldURI FieldURI='item:Body'/>
<t:Message>
<t:Body BodyType='HTML'>Lorizzle ipsum dolor stuff amizzle, hizzle adipiscing dawg. Nullizzle sapien velizzle, check out this volutpizzle, nizzle quizzle, gravida vizzle, shiz. The bizzle eget tortor. Sed erizzle. Fusce izzle da bomb break yo neck, yall bizzle tempizzle gizzle. Maurizzle pellentesque nibh break it down turpizzle. Shizzle my nizzle crocodizzle izzle tortizzle. Fizzle eleifend rhoncizzle phat. Away hac habitasse platea dictumst. Donec we gonna chung. Curabitur mofo urna, pretizzle shizznit, mattis ac, eleifend vitae, nunc. Rizzle suscipizzle. My shizz sempizzle velit sizzle purizzle.</t:Body>
</t:Message>
</t:SetItemField>
</t:Updates>
</t:ItemChange>
</ItemChanges>
</UpdateItem>
</soap:Body>
</soap:Envelope>",
"Token":"long-token-hash",
"ExtensionId":"e2dbabaf-01ec-40f9-8cf8-700586930909"
}
Using HTML outputted by OWA itself when composing an HTML message renders nothing. but also a simple piece of text wrapped in <span>text</span>
does not render anything, already.
What are we missing to make OWA correctly render HTML email bodies ?