Hi, when I use your browse_mailbox example I can get it to retrieve my messages from a gmail account, however as soon as I run the script a second time, the message count reverts to zero. So far the only way I have found to reset this is to go into my gmail settings and switch off POP access and then switch it on again. This is time consuming while I am writing and debugging my code. Can you suggest a better way so stop the code from marking the messages as already retrieved? Thanks!