node-imap icon indicating copy to clipboard operation
node-imap copied to clipboard

Imap search between dates

Open waqas1991 opened this issue 12 years ago • 2 comments

As you know following code search email since may 20, 2010.

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

Now I want to search between to dates For example May 20, 2010 to May 22, 2010

Is it possible to do this operation in imap ?

Thank You, Waqas Ahmed

waqas1991 avatar May 20 '14 09:05 waqas1991

Just use add the 'BEFORE' criteria:

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

mscdex avatar May 20 '14 13:05 mscdex

Thanks ! It worked for me :)

waqas1991 avatar May 21 '14 05:05 waqas1991