Office.MailboxEnums.MoveSpamItemTo enum

注意

此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。

指定在垃圾邮件报告加载项处理报告垃圾邮件或网络钓鱼邮件后,将它移动到的文件夹。

若要了解有关集成垃圾邮件报告功能的详细信息,请参阅 实现集成的垃圾邮件报告加载项 (预览版)

注解

[ API 集:邮箱预览 ]

适用的 Outlook 模式:邮件读取

重要说明:此枚举只能用于将值分配给 event.completed 方法的 moveItemTo 属性。 如果使用的是仅支持 postProcessingAction 属性的 Outlook on Windows 版本,则必须为其分配不同的字符串值。 有关支持的字符串值的列表,请参阅 Office.SpamReportingEventCompletedOptions.postProcessingAction

示例

// The following example handles a SpamReporting event to process a reported spam or phishing message.
function onSpamReport(event) {
    // Get the Base64-encoded EML format of a reported message.
    Office.context.mailbox.item.getAsFileAsync({ asyncContext: event }, (asyncResult) => {
        if (asyncResult.status === Office.AsyncResultStatus.Failed) {
            console.log(`Error encountered during message processing: ${asyncResult.error.message}`);
            return;
        }

        // Run additional processing operations here.

        /**
         * Signal that the spam-reporting event has completed processing.
         * It then moves the reported message to a custom mailbox folder named "Reported Messages"
         * and shows a post-processing dialog to the user.
         * If an error occurs while the message is being processed, the `onErrorDeleteItem`
         * property determines whether the message will be deleted.
         */
        const event = asyncResult.asyncContext;
        event.completed({
            moveItemTo: Office.MailboxEnums.MoveSpamItemTo.CustomFolder,
            folderName: "Reported Messages",
            onErrorDeleteItem: true,
            showPostProcessingDialog: {
                title: "Contoso Spam Reporting",
                description: "Thank you for reporting this message.",
            },
        });
    });
}

字段

CustomFolder = "customFolder"

指定将报告的邮件移动到邮箱中的自定义文件夹。

DeletedItemsFolder = "deletedItemsFolder"

指定将报告的邮件移动到邮箱的 “已删除邮件” 文件夹中。

JunkFolder = "junkFolder"

指定将报告的邮件移动到邮箱的“垃圾邮件Email”文件夹中。

NoMove = "noMove"

指定报告的邮件保留在邮箱中的当前文件夹中。