http://www.perlmonks.org?node_id=245788


in reply to Get messages via IMAP with Perl?

update: whoops the OP wants new messages. In that case you use the qty_recent method or query the unseen response directly.

After logging in, authenticating, and selecting the mailbox, you want to use the qty_messages method. It returns the number of messages.

--
જલધર