Downloading attachments to directory with IMAP in PHP, randomly works
This is perfect working answer, try this. This Sample run properly and download all the attachments with no issues. <?php set_time_limit(3000); /* connect to gmail with your credentials */ $hostname=”{imap.gmail.com:993/imap/ssl}INBOX”; $username=”YOUR_USERNAME”; $password = ‘YOUR_PASSWORD’; /* try to connect */ $inbox = imap_open($hostname,$username,$password) or die(‘Cannot connect to Gmail: ‘ . imap_last_error()); $emails = imap_search($inbox, ‘FROM “abc@gmail.com”‘); … Read more