gpt4 book ai didi

javascript - 在 imap Node.js 中搜索电子邮件

转载 作者:行者123 更新时间:2023-11-28 19:49:26 25 4
gpt4 key购买 nike

我在我的项目中使用 imap 包,我已阅读文档,并且发现它可以在带有日期的电子邮件中进行搜索。

imap.search([ 'UNSEEN', ['SINCE', 'May 20, 2010'] ], function(err, results) {
});

我想搜索两个日期之间的电子邮件,例如 2010 年 5 月 20 日到 2010 年 5 月 28 日。

那么可以在 imap 协议(protocol)中查找日期吗?

最佳答案

你能给出你所引用的模块的引用吗?

如果您使用mscdex/node-imap ,您可以引用

'BEFORE' - Messages whose internal date (disregarding time and timezone) is earlier than the specified date.

'SINCE' - Messages whose internal date (disregarding time and timezone) is within or later than the specified date.

在其 API 文档中https://github.com/mscdex/node-imap/blob/master/README.md#API

search(< array >criteria, < function >callback) - (void)

总结一下

imap.search([ 'UNSEEN', ['SINCE', 'May 20, 2010'], ['BEFORE', 'May 28, 2010'] ],
function(err, results) {
});

就是你想要的...

关于javascript - 在 imap Node.js 中搜索电子邮件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23756698/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com