How to read Internet Headers using WebDAV

We can get Internet Headers/Message Headers via WebDAV using PR_TRANSPORT_MESSAGE_HEADERS MAPI property.

PidTagTransportMessageHeaders Canonical Property



Here is VBScript sample with WebDAV PROPFIND request.

NOTE: Following programming examples is for illustration only, without warranty either expressed or implied,
including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose.
This sample code assumes that you are familiar with the programming language being demonstrated and the tools used
to create and debug procedures.
Dim objX, strR, strRes
Set objX = CreateObject("Microsoft.XMLHTTP")
'Change Item URL, Domain, User, Password
objX.Open "PROPFIND", "http://server/exchange/user/Inbox/Item123.EML", FALSE, "Domain\User", "Password"
strR = "<?xml version='1.0'?>"
strR = strR & "<d:propfind xmlns:d='DAV:' xmlns:m='urn:schemas:mailheader:' "
strR = strR & "xmlns:e='' xmlns:p=''> "
strR = strR & "<d:prop><d:displayname/><p:0x007D001f/></d:prop></d:propfind>"
objX.SetRequestHeader "Content-type:", "text/xml"
objX.SetRequestHeader "Depth", "1"
objx.SetRequestHeader "translate", "f"
strRes = objX.responseText
Msgbox strRes


And following is sample WebDAV SELECT request.

<?xml version="1.0"?>
<D:searchrequest xmlns:D = "DAV:">
<D:sql>SELECT "urn:schemas:mailheader:to",, "urn:schemas:httpmail:subject" FROM "/exchange/user/Inbox/" 
WHERE "DAV:ishidden" = false AND "DAV:isfolder" = false</D:sql>


Please also refer the article mentioned below related to supportability of working with MAPI properties

The Support Guidelines for Client-Side Messaging Development
Refer Section: Integrating with Outlook properties

Comments (0)

Skip to main content