I'm the 'Nobody' who just posted the 'script (of sorts)'.
I did have an ulterior motive, there's something I can't make work. I can only access the first 50 conversations, i.e. the first page. In the line of my script
$gmailer->fetchBox(GM_STANDARD, "inbox", 0); // 0 is first page
The last argument is called 'parameter' and it is used for paging. I'm not clear how it works but it seems to be passed as a 'start=' tag. I assumed the a value other than 0 would give another page. Or that 51 would give the next page. But neither of those values makes any difference - I only get the latest page of conversations.
How do I get previous pages?
First, admitedly, the $parameter parameter is confusing. It's different depending on the first parameter. If you are doing a GM_STANDARD, then 0 is starting with the first conversation. 50 (not 51) would start with the 51st conversation.
In your script, you've put the 51 in the wrong line -- the starting number belongs in line 22. In the line where you have placed the 51 (line 29), that parameter should be the mailbox or label name. If you simply use 0, then libgmailer assumes "inbox".
After correcting line 41 for unescaped quote marks, I have tried your script starting with conversation 30 (the 31st conversation, and it started from there. So it does work. However, I only got 19 conversation files created (in a mailbox with 700+ conversations). That maybe something you need to look into.
Many thanks Neerav
Yes, after your advice I'm now getting all the conversations.
The reason you only got 19 was that they seemed to be available one page of 50 at a time and my loop does $box_display at a time. Also my script had a test line in that hardcoded 50, not what was returned. So setting the 31st conversation would give you the remaining 19.
I've added an outer loop and exit condition and I'm going to clean up the code and will repost it if others seem to want it.
I don't know where the unescaped quote marks are. The original script works and gives correct output. Maybe pasting it into the form somehow corrupted it, so I won't quibble.
I'd be interested in that modified code. Please post it!