Results 3 comments of Jonas

@SkylineGTRS same Problem here. Still trying to find out what the problem is. Suddenly did not work anymore with the error message: "imap_fetchheader(): UID does not exist"

@SkylineGTRS I solved the problem in my project. I did not select the correct folder using switchMailbox($folder).