Exchange 中的 EWS 的电子邮件属性和元素Email properties and elements in EWS in Exchange

了解在 Exchange 中使用 EWS 托管 API 或 EWS 可对电子邮件获取的第一类和其他属性和元素。Learn about the first-class and other properties and elements that you can get on email messages by using the EWS Managed API or EWS in Exchange.

电子邮件的属性超过50个,如果需要,您可以在不知道要查找的位置的情况下获取所需的属性。Email messages have more than 50 properties, and getting the ones you want, when you want them, can be confusing if you don't know where to look. 有关使用电子邮件属性和元素的最重要的一点是,它们包含在一组第一类属性以及每个主要检索方法和操作返回的元素中。The most important thing to know about working with email properties and elements is which are included in the set of first-class properties and elements that is returned by each of the main retrieval methods and operations. 返回的一组第一类属性根据您使用的检索方法的不同而不同。The set of first-class properties that is returned varies based on the retrieval method that you use. 此外,不能 fooled AllProperties 值的BaseShape ews 元素,这一点与 EWS 托管 API 中的BasePropertySet枚举值相对应。It's also important not to be fooled by the AllProperties value of the BaseShape EWS element, which corresponds to the BasePropertySet.FirstClassMessageProperties enumeration value in the EWS Managed API. 此值实际上并不包含所有属性,它只包括第一类属性。This value doesn't actually include all properties, it only includes the first-class properties.

电子邮件的第一类属性和元素First-class properties and elements for email messages

由 ews 托管 API EmailMessage方法和 ews GetItem操作返回的一组第一类属性和元素与由 Ews 托管 api ExchangeService FindItems方法和 ews FindItem操作返回的一组第一类属性和元素稍有不同。The set of first-class properties and elements that are returned by the EWS Managed API EmailMessage.Bind method and the EWS GetItem operation is slightly different than the set of first-class properties and elements that is returned by the EWS Managed API ExchangeService.FindItems method and the EWS FindItem operation. FindItems方法和FindItem操作返回的第一个类属性是由Bind方法和GetItem操作返回的属性的子集。The first-class properties returned by the FindItems method and FindItem operation are a subset of the properties returned by the Bind method and GetItem operation. 表1列出了Bind方法和GetItem操作返回的所有第一类属性,并指定FindItems方法或FindItem操作不会返回这些属性中的哪一个。Table 1 lists all the first-class properties returned by the Bind method and the GetItem operation, and specifies which of those are not returned by the FindItems method or FindItem operation. 请注意,不能扩展FindItems方法或FindItem操作以检索其他属性和元素,如ToRecipientsCcRecipientsBccRecipientsNote that you cannot extend the FindItems method or the FindItem operation to retrieve additional properties and elements such as ToRecipients, CcRecipients, and BccRecipients. 如果需要检索这些值,请使用FindItems方法或FindItem操作获取电子邮件的项目 Id,然后使用Bind方法或GetItem操作检索所需的属性。If you need to retrieve those values, use the FindItems method or the FindItem operation to get the item IDs of the emails, and then use the Bind method or the GetItem operation, to retrieve the required properties. 有关演示如何使用BindFindItems方法检索项目的代码示例,请参阅使用 EWS 托管 API 获取项目For code examples that show how to retrieve items by using the Bind or the FindItems method, see Get an item by using the EWS Managed API. 有关演示如何使用GetItemFindItem操作检索项目的代码示例,请参阅使用 EWS 获取项目For code examples that show how to retrieve items by using the GetItem or FindItem operations, see Get an item by using EWS.

下表按其在响应中出现的顺序列出了第一类属性和元素。The first-class properties and elements are listed in the following table in the order in which they appear in a response.

表1。第一类电子邮件属性和元素Table 1. First-class email properties and elements

EWS 托管 API 属性EWS Managed API property EWS 元素EWS element ****FindItems方法或FindItem操作的第一类属性?First-class property for the FindItems method or the FindItem operation? 读写或只读Read-write or read-only
IdId
ItemIdItemId
Yes
只读Read-only
ParentFolderIdParentFolderId
ParentFolderIdParentFolderId
Yes
只读Read-only
ItemClassItemClass
ItemClassItemClass
Yes
读写Read-write
主题Subject
主题Subject
Yes
读写Read-write
SensitivitySensitivity
SensitivitySensitivity
Yes
只读Read-only
BodyBody
BodyBody
No
读写Read-write
附件Attachments
附件Attachments
No
读写Read-write
DateTimeReceivedDateTimeReceived
DateTimeReceivedDateTimeReceived
Yes
只读Read-only
大小Size
大小Size
Yes
只读Read-only
类别Categories
类别Categories
No
读写Read-write
ImportanceImportance
ImportanceImportance
Yes
读写Read-write
InReplyToInReplyTo
InReplyToInReplyTo
Yes
读写Read-write
IsSubmittedIsSubmitted
IsSubmittedIsSubmitted
Yes
只读Read-only
IsDraftIsDraft
IsDraftIsDraft
Yes
只读Read-only
IsFromMeIsFromMe
IsFromMeIsFromMe
Yes
只读Read-only
IsResendIsResend
IsResendIsResend
Yes
只读Read-only
IsUnmodifiedIsUnmodified
IsUnmodifiedIsUnmodified
Yes
只读Read-only
MessageInternetMessageHeaders
MessageInternetMessageHeaders
No
只读Read-only
DateTimeSentDateTimeSent
DateTimeSentDateTimeSent
Yes
只读Read-only
DateTimeCreatedDateTimeCreated
DateTimeCreatedDateTimeCreated
Yes
只读Read-only
AllowedResponseActionsAllowedResponseActions
ResponseObjectsResponseObjects
No
只读Read-only
ReminderDueByReminderDueBy
ReminderDueByReminderDueBy
Yes
读写Read-write
IsReminderSetIsReminderSet
ReminderIsSetReminderIsSet
Yes
读写Read-write
ReminderMinutesBeforeStartReminderMinutesBeforeStart
ReminderMinutesBeforeStartReminderMinutesBeforeStart
Yes
读写Read-write
DisplayCcDisplayCc
DisplayCcDisplayCc
Yes
只读Read-only
DisplayToDisplayTo
DisplayToDisplayTo
Yes
只读Read-only
HasAttachmentsHasAttachments
HasAttachmentsHasAttachments
Yes
只读Read-only
CultureCulture
CultureCulture
Yes
读写Read-write
EffectiveRightsEffectiveRights
EffectiveRightsEffectiveRights
Yes
只读Read-only
LastModifiedNameLastModifiedName
LastModifiedNameLastModifiedName
Yes
只读Read-only
LastModifiedTimeLastModifiedTime
LastModifiedTimeLastModifiedTime
Yes
只读Read-only
IsAssociatedIsAssociated
IsAssociatedIsAssociated
Yes
读写Read-write
WebClientReadFormQueryStringWebClientReadFormQueryString
WebClientReadFormQueryStringWebClientReadFormQueryString
Yes
只读Read-only
WebClientEditFormQueryStringWebClientEditFormQueryString
WebClientEditFormQueryStringWebClientEditFormQueryString
Yes
只读Read-only
ConversationIdConversationId
ConversationIdConversationId
Yes
只读Read-only
FlagFlag
FlagFlag
Yes
读写Read-write
InstanceKeyInstanceKey
InstanceKeyInstanceKey
Yes
只读Read-only
EntityExtractionResultEntityExtractionResult
EntityExtractionResultEntityExtractionResult
No
只读Read-only
SenderSender
SenderSender
Yes
读写Read-write
ToRecipientsToRecipients
ToRecipientsToRecipients
No
只读Read-only
CcRecipientsCcRecipients
CcRecipientsCcRecipients
No
只读Read-only
BccRecipientsBccRecipients
BccRecipientsBccRecipients
No
只读Read-only
IsReadReceiptRequestedIsReadReceiptRequested
IsReadReceiptRequestedIsReadReceiptRequested
Yes
读写Read-write
IsDeliveryReceiptRequestedIsDeliveryReceiptRequested
IsDeliveryReceiptRequestedIsDeliveryReceiptRequested
Yes
读写Read-write
ConversationIndexConversationIndex
ConversationIndexConversationIndex
Yes
只读Read-only
ConversationTopicConversationTopic
ConversationTopicConversationTopic
Yes
只读Read-only
FromFrom
FromFrom
Yes
读写Read-write
InternetMessageIdInternetMessageId
InternetMessageIdInternetMessageId
Yes
只读Read-only
IsReadIsRead
IsReadIsRead
Yes
读写Read-write
IsResponseRequestedIsResponseRequested
IsResponseRequestedIsResponseRequested
Yes
读写Read-write
ReplyToReplyTo
ReplyToReplyTo
No
只读Read-only
ReferencesReferences
ReferencesReferences
Yes
读写Read-write
ReceivedByReceivedBy
ReceivedByReceivedBy
Yes
只读Read-only
ReceivedRepresentingReceivedRepresenting
ReceivedRepresentingReceivedRepresenting
Yes
只读Read-only

电子邮件的其他属性和元素Other properties and elements for email messages

并非所有重要的电子邮件属性和元素都是第一类的属性和元素。Not all important email properties and elements are first-class properties and elements. 若要获取其他属性或元素,需要将它们添加到PropertySet中(如果使用的是 EWS 托管 API),或者使用属性路径将它们添加到 ews 操作调用中。To get the other properties or elements, you need to add them to your PropertySet if you're using the EWS Managed API, or use a property path to add them to your EWS operation call. 例如,若要检索邮件的文本正文和 MIME 内容,请创建您的PropertySet ,如BindLoad方法所示。For example, to retrieve the text body and the MIME content of a message, create your PropertySet as shown for the Bind or Load method.

PropertySet(BasePropertySet.IdOnly, ItemSchema.TextBody, ItemSchema.MimeContent);

或者,如果您正在使用 EWS,请将元素添加到GetItem操作请求中的AdditionalProperties元素中,如下所示。Or if you're using EWS, add the elements to the AdditionalProperties element in your GetItem operation request, as shown.

<t:AdditionalProperties>
    <t:FieldURI FieldURI="item:TextBody" />
    <t:FieldURI FieldURI="item:MimeContent" />
</t:AdditionalProperties>

继承自 EWS 托管 API ServiceObject对象的EmailMessage属性不能包含在Bind方法的属性集中;但是,所有ServiceObject属性在EmailMessage对象中都是可读的,并由Bind方法检索。EmailMessage properties inherited from the EWS Managed API ServiceObject object cannot be included in a property set for the Bind method; however, all the ServiceObject properties are readable on the EmailMessage object and are retrieved by the Bind method.

表2。其他电子邮件属性和元素Table 2. Other email properties and elements

EWS 托管 API 属性EWS Managed API property EWS 元素EWS element 读写或只读Read-write or read-only
ArchiveTagArchiveTag
ArchiveTagArchiveTag
读写Read-write
ExtendedPropertiesExtendedProperties
ExtendedPropertyExtendedProperty
只读Read-only
IconIndexIconIndex
IconIndexIconIndex
只读Read-only
IsAttachmentIsAttachment
不可用Not available
只读Read-only
IsDirtyIsDirty
不可用Not available
只读Read-only
IsNewIsNew
不可用Not available
只读Read-only
ItemItem
ItemItem
只读Read-only
MimeContentMimeContent
MimeContentMimeContent
只读Read-only
不可用Not available
MimeContentUTF8MimeContentUTF8
只读Read-only
NormalizedBodyNormalizedBody
NormalizedBodyNormalizedBody
只读Read-only
PolicyTagPolicyTag
PolicyTagPolicyTag
读写Read-write
预览Preview
预览Preview
读写Read-write
RetentionDateRetentionDate
RetentionDateRetentionDate
只读Read-only
架构Schema
不可用Not available
只读Read-only
服务Service
不可用Not available
只读Read-only
StoreEntryIdStoreEntryId
StoreEntryIdStoreEntryId
只读Read-only
TextBodyTextBody
TextBodyTextBody
只读Read-only
UniqueBodyUniqueBody
UniqueBodyUniqueBody
只读Read-only

另请参阅See also