邮件资源类型message resource type

mailFolder 中的邮件。A message in a mailFolder.

从 Exchange Online 邮箱发送的单个电子邮件的 toRecipientsccRecipientsbccRecipients 属性包含的最大收件人数为 500。The maximum total number of recipients included in the toRecipients, ccRecipients, and bccRecipients properties for a single email message sent from an Exchange Online mailbox is 500. 有关详细信息,请参阅发送限制For more information, see Connector limits.

该资源支持:This resource supports:

  • 将你自己的数据添加为自定义 Internet 邮件头。Adding your own data as custom Internet message headers. 仅在创建邮件时添加自定义邮件头,并以“x-”开头命名。Add custom headers only when creating a message, and name them starting with "x-". 邮件发送后,便无法修改邮件头。Once the message has been sent, you cannot modify the headers. 若要获取邮件头,请在获取邮件操作中应用 $select 查询参数。To get the headers of a message, apply the $select query parameter in a get message operation.
  • 将你自己的数据作为扩展添加到自定义属性。Adding your own data as custom properties as extensions.
  • 订阅更改通知Subscribing to change notifications.
  • 通过提供 delta 函数,使用 delta 查询跟踪增量添加、删除和更新。Using delta query to track incremental additions, deletions, and updates, by providing a delta function.

方法Methods

方法Method 返回类型Return Type 说明Description
列出邮件List messages 邮件集合message collection 获取已登录用户的邮箱中的所有邮件(包括“已删除邮件”和“待筛选邮件”文件夹)。Get all the messages in the signed-in user's mailbox (including the Deleted Items and Clutter folders).
创建邮件Create message 邮件message 创建 新邮件的草稿。Create a draft of a new message.
获取邮件Get message 邮件message 读取 message 对象的属性和关系。Read properties and relationships of message object.
更新Update 邮件message 更新 message 对象。Update message object.
删除Delete None 删除 message 对象。Delete message object.
复制copy 邮件Message 将邮件复制到文件夹。Copy a message to a folder.
createForwardcreateForward 邮件Message 创建转发邮件的草稿。然后,你可以 更新发送 草稿。Create a draft of the Forward message. You can then update or send the draft.
createReplycreateReply 邮件Message 创建回复邮件的草稿。然后,你可以 更新发送 草稿。Create a draft of the Reply message. You can then update or send the draft.
createReplyAllcreateReplyAll 邮件Message 创建全部答复邮件的草稿。然后,你可以 更新发送 草稿。Create a draft of the Reply All message. You can then update or send the draft.
deltadelta 邮件集合message collection 获取指定文件夹中已添加、删除或更新的邮件集。Get a set of messages that have been added, deleted, or updated in a specified folder.
转发forward None 转发邮件。然后邮件保存在已发送邮件文件夹中。Forward a message. The message is then saved in the Sent Items folder.
移动move 邮件Message 将邮件移动到文件夹。该操作会在目标文件夹中创建邮件的新副本。Move the message to a folder. This creates a new copy of the message in the destination folder.
回复reply None 答复邮件发件人然后邮件保存在已发送邮件文件夹中。Reply to the sender of a message. The message is then saved in the Sent Items folder.
replyAllreplyAll None 答复邮件的所有收件人。然后邮件保存在已发送邮件文件夹中。Reply to all recipients of a message. The message is then saved in the Sent Items folder.
发送send None 发送以前创建的邮件草稿。然后邮件保存在已发送邮件文件夹中。Sends a previously created message draft. The message is then saved in the Sent Items folder.
附件Attachments
列出附件List attachments 附件 集合Attachment collection 获取邮件的所有附件。Gets all attachments on a message.
Add attachmentAdd attachment AttachmentAttachment 通过发布到附件集合,向邮件添加新附件。Add a new attachment to a message by posting to the attachments collection.
开放扩展Open extensions
创建开放扩展Create open extension openTypeExtensionopenTypeExtension 创建开放扩展,并在新建或现有的资源实例中添加自定义属性。Create an open extension and add custom properties in a new or existing instance of a resource.
获取开放扩展Get open extension openTypeExtension 集合openTypeExtension collection 获取通过名称或完全限定的名称识别的一个或多个开放扩展对象。Get an open extension object or objects identified by name or fully qualified name.
架构扩展Schema extensions
添加架构扩展值Add schema extension values 创建架构扩展定义,然后使用它向资源添加自定义键入数据。Create a schema extension definition and then use it to add custom typed data to a resource.
扩展属性Extended properties
创建单值扩展属性Create single-value extended property 邮件message 在新建或现有的邮件中创建一个或多个单值扩展属性。Create one or more single-value extended properties in a new or existing message.
获取具有单值扩展属性的邮件Get message with single-value extended property 邮件message 通过使用 $expand$filter 获取包含单值扩展属性的邮件。Get messages that contain a single-value extended property by using $expand or $filter.
创建多值扩展属性Create multi-value extended property 邮件message 在新建或现有的邮件中创建一个或多个多值扩展属性。Create one or more multi-value extended properties in a new or existing message.
获取具有多值扩展属性的邮件Get message with multi-value extended property 邮件message 使用 $expand 获取包含一个多值扩展属性的邮件。Get a message that contains a multi-value extended property by using $expand.

属性Properties

属性Property 类型Type 说明Description
bccRecipientsbccRecipients recipient collectionrecipient collection 邮件的密件抄送收件人。The Bcc: recipients for the message.
bodybody itemBodyitemBody 邮件的正文。The body of the message. 可以是 HTML 格式或文本格式。It can be in HTML or text format. 查看有关邮件正文中的安全 HTML的信息。Find out about safe HTML in a message body.
bodyPreviewbodyPreview 字符串String 邮件正文中的前 255 个字符。文本格式。The first 255 characters of the message body. It is in text format.
categoriescategories String collectionString collection 与邮件关联的类别。The categories associated with the message.
ccRecipientsccRecipients recipient collectionrecipient collection 邮件的抄送收件人。The Cc: recipients for the message.
changeKeychangeKey StringString 邮件的版本。The version of the message.
conversationIdconversationId StringString 电子邮件所属的对话的 ID。The ID of the conversation the email belongs to.
createdDateTimecreatedDateTime DateTimeOffsetDateTimeOffset 创建邮件的日期和时间。The date and time the message was created.
flagflag followupFlagfollowupFlag 指示邮件的状态、开始日期、截止日期或完成日期的标志值。The flag value that indicates the status, start date, due date, or completion date for the message.
发件人from recipientrecipient 邮箱所有者和邮件发件人。The mailbox owner and sender of the message. 值必须对应于使用的实际邮箱。The value must correspond to the actual mailbox used. 查看更多有关为邮件设置 from 和 sender 属性的信息。Find out more about setting the from and sender properties of a message.
hasAttachmentshasAttachments BooleanBoolean 指明邮件是否包含附件。此属性不涉及内联附件。因此,如果邮件仅包含内联附件,此属性为 false。若要验证是否存在内联附件,请分析 body 属性,以确定是否有 src 属性(例如,<IMG src="cid:image001.jpg@01D26CD8.6C05F070">)。Indicates whether the message has attachments. This property doesn't include inline attachments, so if a message contains only inline attachments, this property is false. To verify the existence of inline attachments, parse the body property to look for a src attribute, such as <IMG src="cid:image001.jpg@01D26CD8.6C05F070">.
idid StringString 邮件的唯一标识符(请注意,此值可能会随着邮件移动或更改而更改)Unique identifier for the message (note that this value may change if a message is moved or altered)
importanceimportance importanceimportance 邮件的重要性:LowNormalHighThe importance of the message: Low, Normal, High.
inferenceClassificationinferenceClassification inferenceClassificationTypeinferenceClassificationType 根据推导出的相关性或重要性或根据显式重写,对用户邮件的分类。The classification of the message for the user, based on inferred relevance or importance, or on an explicit override. 可能的值为:focusedotherThe possible values are: focused or other.
internetMessageHeadersinternetMessageHeaders internetMessageHeader 集合internetMessageHeader collection RFC5322 定义的邮件头集合。A collection of message headers defined by RFC5322. 该集合包括指示邮件从发件人发送到收件人所采用的网络路径的邮件头。The set includes message headers indicating the network path taken by a message from the sender to the recipient. 还可以包含保存邮件应用数据的自定义邮件头。It can also contain custom message headers that hold app data for the message.

仅在应用 $select 查询选项时返回。Returned only on applying a $select query option. 只读。Read-only.
internetMessageIdinternetMessageId StringString RFC2822 指定格式的邮件 ID。The message ID in the format specified by RFC2822.
isDeliveryReceiptRequestedisDeliveryReceiptRequested BooleanBoolean 指示是否需要发送邮件已读回执。Indicates whether a read receipt is requested for the message.
isDraftisDraft BooleanBoolean 指示邮件是否为草稿。如果尚未发送,则此邮件是一封草稿。Indicates whether the message is a draft. A message is a draft if it hasn't been sent yet.
isReadisRead BooleanBoolean 指示是否已阅读该邮件。Indicates whether the message has been read.
isReadReceiptRequestedisReadReceiptRequested BooleanBoolean 指示是否需要发送邮件已读回执。Indicates whether a read receipt is requested for the message.
lastModifiedDateTimelastModifiedDateTime DateTimeOffsetDateTimeOffset 上次更改邮件的日期和时间。The date and time the message was last changed.
parentFolderIdparentFolderId StringString 邮件的父 MailFolder 的唯一标识符。The unique identifier for the message's parent mailFolder.
receivedDateTimereceivedDateTime DateTimeOffsetDateTimeOffset 收到邮件的日期和时间。The date and time the message was received.
replyToreplyTo recipient collectionrecipient collection 在答复时使用的电子邮件地址。The email addresses to use when replying.
sendersender recipientrecipient 实际用于生成邮件的帐户。The account that is actually used to generate the message. 大多数情况下,此值与“from”属性相同。In most cases, this value is the same as the from property. 共享邮箱发送邮件或将邮件作为委托发送时,可以将此属性设置为其他值。You can set this property to a different value when sending a message from a shared mailbox, or sending a message as a delegate. 在任何情况下,此值必须对应于使用的实际邮箱。In any case, the value must correspond to the actual mailbox used. 查看更多有关为邮件设置 from 和 sender 属性的信息。Find out more about setting the from and sender properties of a message.
sentDateTimesentDateTime DateTimeOffsetDateTimeOffset 发送邮件的日期和时间。The date and time the message was sent.
subjectsubject StringString 邮件的主题。The subject of the message.
toRecipientstoRecipients recipient collectionrecipient collection 邮件的收件人。The To: recipients for the message.
uniqueBodyuniqueBody itemBodyitemBody 对于当前邮件独一无二的邮件正文部分。uniqueBody 默认不返回,但可以使用 ?$select=uniqueBody 查询为给定邮件检索它。可以是 HTML 格式或文本格式。The part of the body of the message that is unique to the current message. uniqueBody is not returned by default but can be retrieved for a given message by use of the ?$select=uniqueBody query. It can be in HTML or text format.
webLinkwebLink StringString 要在 Outlook Web App 中打开邮件的 URL。The URL to open the message in Outlook Web App.

可以将 ispopout 参数附加到此 URL 的末尾以更改邮件的显示方式。如果 ispopout 不存在或设置为 1,则邮件显示在弹出窗口中。如果 ispopout 设置为 0,则浏览器将在 Outlook Web App 审阅窗格中显示邮件。You can append an ispopout argument to the end of the URL to change how the message is displayed. If ispopout is not present or if it is set to 1, then the message is shown in a popout window. If ispopout is set to 0, then the browser will show the message in the Outlook Web App review pane.

如果通过 Outlook Web App 登录邮箱,该邮件将在浏览器中打开。如果尚未使用浏览器登录,系统将提示你登录。The message will open in the browser if you are logged in to your mailbox via Outlook Web App. You will be prompted to login if you are not already logged in with the browser.

可以从 iFrame 中访问此 URL。This URL can be accessed from within an iFrame.

关系Relationships

关系Relationship 类型Type 说明Description
attachmentsattachments 附件集合attachment collection 邮件的 fileAttachmentitemAttachment 附件。The fileAttachment and itemAttachment attachments for the message.
extensionsextensions 扩展集合extension collection 为邮件定义的开放扩展集合。The collection of open extensions defined for the message. 可为空。Nullable.
multiValueExtendedPropertiesmultiValueExtendedProperties multiValueLegacyExtendedProperty 集合multiValueLegacyExtendedProperty collection 为邮件定义的多值扩展属性的集合。The collection of multi-value extended properties defined for the message. 可为空。Nullable.
singleValueExtendedPropertiessingleValueExtendedProperties singleValueLegacyExtendedProperty collectionsingleValueLegacyExtendedProperty collection 为邮件定义的单值扩展属性的集合。可为空。The collection of single-value extended properties defined for the message. Nullable.

JSON 表示形式JSON representation

下面是资源的 JSON 表示形式。Here is a JSON representation of the resource

{
  "bccRecipients": [{"@odata.type": "microsoft.graph.recipient"}],
  "body": {"@odata.type": "microsoft.graph.itemBody"},
  "bodyPreview": "string",
  "categories": ["string"],
  "ccRecipients": [{"@odata.type": "microsoft.graph.recipient"}],
  "changeKey": "string",
  "conversationId": "string",
  "createdDateTime": "String (timestamp)",
  "flag": {"@odata.type": "microsoft.graph.followupFlag"},
  "from": {"@odata.type": "microsoft.graph.recipient"},
  "hasAttachments": true,
  "id": "string (identifier)",
  "importance": "String",
  "inferenceClassification": "String",
  "internetMessageHeaders": [{"@odata.type": "microsoft.graph.internetMessageHeader"}],
  "internetMessageId": "String",
  "isDeliveryReceiptRequested": true,
  "isDraft": true,
  "isRead": true,
  "isReadReceiptRequested": true,
  "lastModifiedDateTime": "String (timestamp)",
  "parentFolderId": "string",
  "receivedDateTime": "String (timestamp)",
  "replyTo": [{"@odata.type": "microsoft.graph.recipient"}],
  "sender": {"@odata.type": "microsoft.graph.recipient"},
  "sentDateTime": "String (timestamp)",
  "subject": "string",
  "toRecipients": [{"@odata.type": "microsoft.graph.recipient"}],
  "uniqueBody": {"@odata.type": "microsoft.graph.itemBody"},
  "webLink": "string",

  "attachments": [{"@odata.type": "microsoft.graph.attachment"}],
  "extensions": [{"@odata.type": "microsoft.graph.extension"}],
  "multiValueExtendedProperties": [{"@odata.type": "microsoft.graph.multiValueLegacyExtendedProperty"}],
  "singleValueExtendedProperties": [{"@odata.type": "microsoft.graph.singleValueLegacyExtendedProperty"}]
}

另请参阅See also