javascript - Searching email in imap Node.js - Stack Overflow

I am using imap package in my project I have read the documentation and I found this for searching in e

I am using imap package in my project I have read the documentation and I found this for searching in email with date.

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

I want to search email between two dates for example May 20, 2010 to May 28,2010.

So it possible to find between dates in imap protocol ?

I am using imap package in my project I have read the documentation and I found this for searching in email with date.

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

I want to search email between two dates for example May 20, 2010 to May 28,2010.

So it possible to find between dates in imap protocol ?

Share Improve this question asked May 20, 2014 at 10:02 Waqas AhmedWaqas Ahmed 4931 gold badge5 silver badges24 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

Can you give reference to the module you refer to?

If you are using mscdex/node-imap, you can refer to

'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.

in its API documentation https://github./mscdex/node-imap/blob/master/README.md#API

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

so to sum up

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

is what you want ...

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743370917a4462503.html

相关推荐

  • javascript - Searching email in imap Node.js - Stack Overflow

    I am using imap package in my project I have read the documentation and I found this for searching in e

    1天前
    70

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信