Skip to content
Advertisement

Search Email Of Last N Minutes Using IMAP-TOOLS

The following code uses IMAP to log into an Outlook email and checks the contents of the Junk folder.

It returns the content of the last unseen email with subject "Title".

I would like to add one thing to the source code.

Is it possible to get the last email of for example the last 10 minutes? So that he doesn’t return older emails.

JavaScript

Advertisement

Answer

There is no search by time in IMAP REF: https://www.rfc-editor.org/rfc/rfc3501#section-6.4.4

Anyway you can do it:

JavaScript

https://github.com/ikvk/imap_tools , I am author

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement