Message Fields

Message Fields

Fields for instances of the Message Component Object Model (COM) class reside in the urn:schemas:mailheader:, urn:schemas:httpmail:, and the https://schemas.microsoft.com/exchange/ Uniform Resource Identifier (URI) namespaces. All fields within these namespaces can be used to examine or modify not only the mail header fields for the message, but also the message itself.

Although the number of namespaces appears large, the underlying information is the same for many fields within different namespaces, and all that differs between them is the variable type in which they are returned. In general, every message header field for a Message object can be accessed within the urn:schemas:mailheader: namespace, but all are returned as US-ASCII strings with any non US-ASCII characters encoded according to RFC 1522. Associated fields within the urn:schemas:httpmail:namespace and the https://schemas.microsoft.com/exchange/sensitivityfield return the same information but in a different format: within the urn:schemas:httpmail: namespace, fields are returned as either RFC 1522 decoded UNICODE characters (that is, not RFC 1522 encoded US-ASCII character sequences) or Automation DATE variables (that is, rather than US-ASCII strings). The https://schemas.microsoft.com/exchange/sensitivityfield returns an enumerated value rather than a string, which represents the sensitivity of the message.

Note   When accessing fields in the urn:schemas:mailheader: namespace, the underlying OLE DB type for the majority of fields is DBTYPE_STR (a char string); however, the Microsoft® Active X® Data Objects (ADO) Fields collection is dual, and therefore compatible with Automation. This means that single-byte characters must be returned as wchar_t (UNICODE, or two byte) characters. This does not mean, however, that non US-ASCII characters encoded per RFC 1522 are subsequently decoded when returned. The encoding characters remain intact.

See Also

Concepts

urn:schemas:mailheader: Namespace
urn:schemas:httpmail: Namespace
https://schemas.microsoft.com/exchange/ Namespace