【问题标题】:Creating a Thunderbird addon to move a mail into a folder创建 Thunderbird 插件以将邮件移动到文件夹中
【发布时间】:2021-02-07 06:23:50
【问题描述】:

我想在 Thunderbird 中创建一个按钮来将选定的电子邮件移动到一个文件夹中。 通过这个例子,很容易创建一个按钮: https://developer.thunderbird.net/add-ons/mailextensions/hello-world-add-on 但是如何将逻辑添加到 background.js 中以移动邮件?

在我以前的插件中,Thunderbirg 78 不再支持,我可以使用这个 js 代码:

var targetUri = "mailbox://nobody@Local%20Folders/Inbox/backlog";
var targetFolder =  MailUtils.getFolderForURI(targetUri);
MsgMoveMessage(targetFolder);

谢谢

【问题讨论】:

    标签: thunderbird


    【解决方案1】:

    我没有尝试过,但这似乎正是message.move() API 的用途。

    这里是方法的描述:

    move(messageIds, destination)

    将邮件移动到指定文件夹。

    • messageIds(整数数组)要移动的消息的 ID。
    • destination (MailFolder) 要将邮件移动到的文件夹。

    使用messageDisplay.getDisplayedMessages() 获取显示消息的ID 看起来很容易,或者您可以使用messages.query() 获取您想要的消息,但是我不确定API 当前是否提供了获取消息ID 的方法你会从消息列表中选择

    【讨论】:

      猜你喜欢
      • 2017-06-11
      • 1970-01-01
      • 1970-01-01
      • 2021-05-12
      • 2019-09-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多