Question

I'm using POP3 to fetch emails from gmail, I want to fetch a list of folders present in my gmail account but not finding a way of doing it. In IMAP there's a method list("","*") through which we can fetch the folders and then by using select("folder_name") we could fetch the emails.

How to fetch the list of folders via POP3. Please help. Thanks.

Was it helpful?

Solution

POP3 does not have the concept of folders. It is a very old mail protocol. There is only the Inbox. If you ever see folders on a POP3 client (like in outlook), that is a client side implementation. There are no folders on a POP3 server.

If you need access to the Gmail folders, you need to use IMAP.

hth,
Dave

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top