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());