I’d like to retrieve two folders using the select method. I’d like to get the “Inbox” as well as the “Sent”.
Is there a way to do this? Currently, the only way I know of, I can only get one folder at a time using:
IMAP4.select('INBOX')
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Selecting an IMAP folder does not retrieve any messages, it just selects that folder. If you to get a message (or attributes of it like flags or the internal date), you need to use FETCH.
If you want to get all messages in two folders, simply loop through each of them in turn.