Office.MailboxEnums.MoveSpamItemTo enum

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

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

注解

API 集:邮箱 1.14

适用的 Outlook 模式:消息阅读

重要提示: 此枚举只能用于将值赋值给 event.completed 方法的 moveItemTo 属性。 如果所使用的 Windows 版 Outlook 仅支持该 postProcessingAction 属性,则必须为其分配不同的字符串值。 有关支持的字符串值的列表,请参阅 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"

指定将报告的邮件移动到邮箱的 Junk Email 文件夹。

NoMove = "noMove"

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