PHP Classes

new functions

Recommend this page to a friend!

      Receive Mail  >  All threads  >  new functions  >  (Un) Subscribe thread alerts  
Subject:new functions
Summary:move to other folder and get number of unread msg
Messages:1
Author:Krystian
Date:2016-10-27 08:12:38
 

  1. new functions   Reply   Report abuse  
Picture of Krystian Krystian - 2016-10-27 08:12:38
public function set_move_email($mid=null, $target="INBOX") {
if(!$this->is_connected || is_null($mid))
return false;
return imap_mail_move($this->marubox,$mid, $target);
}


public function get_number_of_unread()
{
if(strtolower($this->protocol) != 'imap') {
echo "Warning: The function get_number_of_unread will not work on '".$this->protocol."' Protocol";
return false;
}
if(!$this->is_connected)
return false;

$result = imap_search($this->marubox, 'UNSEEN');
if (is_array($result)) return count($result);
else return 0;
}