title: imap_delete not working
body: <p>I am using php imap functions to parse the message from webmail. I can fetch messages one by one and save them in DB. After saving, I want to delete the inbox message. imap_delete function is not working here. My code is like that:</p>
  
  <pre><code>$connection = pop3_login($host,$port,$user,$pass,$folder="INBOX",$ssl=false);//connect
  $stat = pop3_list($connection);//list messages
  
  foreach($stat as $line) {
    //save in db codes...
    imap_delete($connection, $line['msgno']);//flag as delete
  }
  
  imap_close($connection, CL_EXPUNGE);
  </code></pre>
  
  <p>I also tested - <code>imap_expunge($connection);</code><br>
  But it is not working. The messages are not deleted. Please help me out...</p>