I am trying to fetch Gmail sent items using Imap but it gives me error saying "Notice: Unknown: [NONEXISTENT] Unknown Mailbox: Sent (Failure) (errflg=2) in Unknown on line 0"
$hostname = '{imap.gmail.com:993/imap/ssl}Sent';
$username = '[email protected]';
$password = '****************';
/* try to connect */
$inbox = imap_open($hostname,$username,$password) or die('Cannot connect to Gmail: ' . imap_last_error());
For Gmail users, there's a Gmail IMAP that automatically saves the sent mails to Sent file.
IMAP is a standard email protocol that stores email messages on a mail server and it also allows the end user or application to view and manipulate the messages as though they were stored locally on the end user's computing device(s). The IMAP is required for the following cloudHQ operations: Backup of Gmail.
Generally, the error related to the IMAP protocol is due to the wrong settings, improper connection, slow Internet speed, or the outdated version of the email client. First, you should check all these aspects and accordingly correct them. It might turn the Gmail account into working smoothly like before.
Normally if you are using a browser at mail.google.com and your sent messages aren't in the Sent view, that would mean that they have been deleted.
I believe the 'Sent' folder is actually [Gmail]/Sent Mail
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With