What is the difference between the fetch command and the search command in IMAP?
I am trying to get the messages in my inbox, I use the following command to retrieve the UID:
sb = receiveResponse("$ UID SEARCH ALL\r\n");
then I use this command to fetch a particular message header:
sb = receiveResponse("$ FETCH " + number+ " BODY.PEEK[HEADER.FIELDS (From Subject Date)]\r\n");
Does the fetch command use the UID to get the message header or does it use the message number?
If it uses the message number, how do I retrieve the message numbers?