Hack Forums
[PHP] Cannot delete gmail mail using IMAP - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Web Development (https://hackforums.net/forumdisplay.php?fid=183)
+---- Thread: [PHP] Cannot delete gmail mail using IMAP (/showthread.php?tid=3980125)



Cannot delete gmail mail using IMAP - n31ght0 - Jan 6, 2014

please help i try to delete 1 mail from my gmail using IMAP but my code seem not working

PHP Code

<?php

$mbox 
= imap_open("{imap.gmail.com:993/ssl}[Gmail]/INBOX", "[email protected]", "dick")
    or die(
"Can't connect: " . imap_last_error());

imap_mail_move($mbox,1,"[Gmail]/Trash"); 
imap_expunge($mbox);

imap_close($mbox);
?>


solved
must use {imap.gmail.com:993/imap/ssl}INBOX and imap_mail_move($mbox,"1",'[Gmail]/Trash');
but a new problem is it's deleted twice #sad :(