I want to get emails from gmail, but I want to get the folder ‘All Mail’
I have the following:
$server = '{imap.gmail.com:993/ssl}';
$user = 'myUser';
$password = 'myPassword';
$connection = imap_open($server, $user, $password);
$count = imap_num_msg($connection);
echo $count;
The echo however is echoing the emails in the inbox only, how can I make it read a certain folder, or all the folders?
Thank you!
Use this to get all mail:
We went round and round on this awhile; see here:
https://stackoverflow.com/a/8178514/776695
As stated here, use
imap_listto see which individual folders are available