【问题标题】:How get header data from nsIMsgDBHdr in Thunderbird?如何从 Thunderbird 中的 nsIMsgDBHdr 获取标头数据?
【发布时间】:2016-11-04 08:08:24
【问题描述】:

我正在尝试从nsIMsgDBHdr 界面获取自定义消息。

let result = msgHdr.getProperty('x-custom');

但是result 是空的。

我尝试在preferences 中注册标题,但这没有效果。 请帮忙。

【问题讨论】:

    标签: thunderbird email-headers thunderbird-addon


    【解决方案1】:

    已解决问题。

    Components.utils.import("resource:///modules/Services.jsm");
    let pref = "mailnews.customDBHeaders";
    let chNames = ['x-custom', 'x-custom-2'];
    // Save preferences.
    Services.prefs.setCharPref(pref, chNames.join(" ").trim());
    

    通过 nsIMsgDBHdr 获取自定义标头:

    msgHdr.getStringProperty('x-custom');
    

    自定义标题只会出现在新邮件中。为了它们出现在所有电子邮件中 ​​- 有必要重新索引数据库。

    【讨论】:

      猜你喜欢
      • 2017-01-18
      • 1970-01-01
      • 2016-07-27
      • 2012-10-26
      • 2020-03-05
      • 2013-05-28
      • 1970-01-01
      • 2023-03-13
      • 1970-01-01
      相关资源
      最近更新 更多