/** * Get information about the current mailbox * * @return object|bool */ public function mailInfo() { $this->_mailInfo = imap_mailboxmsginfo($this->_connection); if (!$this->_mailInfo) { echo "get mailInfo failed: " . imap_last_error(); return false; } return $this->_mailInfo; }
public function pop3_stat($connection = null) { if ($this->connection) { $check = imap_mailboxmsginfo($this->connection); return (array) $check; } else { return NULL; } }
function info($inBox) { global $user, $pass; // $mbox = imap_open($inBox, $user, $pass); if (!$mbox) { die("Mailbox open FAILED."); } // $info = imap_mailboxmsginfo($mbox); // imap_close($mbox); return $info; }
/** * Constructs a new iNotePrecipitator object. * * @param string $email The email address used to log into the iCloud account. * @param string $password The password used to log into the iCloud account. */ function __construct($email, $password) { //explode email address into username and domain $this->username = explode("@", $email)[0]; $this->domain = explode("@", $email)[1]; //Open the connection to iCloud notes mailbox $this->imap = imap_open('{imap.mail.me.com:993/imap/ssl}Notes', $this->username, $password); //set the login status if (!$this->imap) { $this->login_success = FALSE; } else { $this->login_success = TRUE; } //get our mailbox info $this->notes_mailbox_info = get_object_vars(imap_mailboxmsginfo($this->imap)); }
/** * Get detailed info about imap mail box */ public function getMessageBoxStatsDetailed() { return imap_mailboxmsginfo($this->imapStream); }
public function mailbox_info($type = 'obj') { if ($this->stream) { $info = imap_mailboxmsginfo($this->stream); if ($info) { if ($type == 'array') { $info_array = get_object_vars($info); return $info_array; } else { return $info; } } else { // There was an error return imap_last_error(); } } // Not connected return imap_last_error(); }
/** * Get information about the current mailbox */ public function getInfo() { // note: imap_mailboxmsginfo not quite support pop3 if ($this->service == 'imap') { $this->info = imap_mailboxmsginfo($this->stream); } else { $this->info = imap_status($this->stream, $this->mailbox_params, $option); } return $this->info; }
public function getMailBoxInfo($imap) { $mailboxinfo = imap_mailboxmsginfo($imap); //print_r($recentmessagecount); return $mailboxinfo; }
public function stat() { $check = imap_mailboxmsginfo($this->conn); return (array) $check; }
function pathStat($p) { $ret = array(); // $ret = imap_status($this->_c, self::folderName($p), SA_ALL); // print_r($ret); // $x = $this->stat(); // print_r($x); $ret['msg_max'] = imap_num_msg($this->_c); $ret['msg_info'] = imap_mailboxmsginfo($this->_c); return $ret; }
/** * @param $callback function that is called with parsed mail header + attachments */ function getMail($callback = '', $timeout = 30) { if (!$this->connect()) { echo "ERROR: IMAP connection to " . $this->server . ":" . $this->port . " failed\n"; return false; } $folders = imap_listmailbox($this->handle, '{' . $this->server . ':' . $this->port . '}', '*'); $msginfo = imap_mailboxmsginfo($this->handle); //dp('found '.$msginfo->Nmsgs.' messages in mailbox'); $this->tot_mails = $msginfo->Nmsgs; for ($i = 1; $i <= $this->tot_mails; $i++) { //dp("Downloading ".$i." of ".$this->tot_mails." ..."); //XXX hack because retarded imap_fetchbody() dont allow to fetch the whole message $fp = fopen('php://temp', 'w'); imap_savebody($this->handle, $fp, $i); rewind($fp); $msg = stream_get_contents($fp); fclose($fp); $mime = new MimeReader(); $mime->parseMail($msg); $this->emails[] = $mime->getAsEMail($i); } if (!function_exists($callback)) { throw new \Exception('ERROR callback function ' . $callback . ' not found'); } call_user_func($callback, $this->emails, $this); }
public function getUnread() { $this->init(); $comprobar = imap_mailboxmsginfo($this->connection->getResource()); return $comprobar->Unread; }
function getMailboxInfo($ret = true) { // It's possible that this function has already been called by $this->connect // If so, the 'Mailbox' indice will already exist and the user just wants // the contents of the mailboxInfo member variable. if (!isset($this->mailboxInfo['Mailbox'])) { $this->mailboxInfo = @array_merge($this->mailboxInfo, get_object_vars(imap_mailboxmsginfo($this->mailbox))); } return $ret ? $this->mailboxInfo : true; }
$tipoMed = $_SESSION['tipoMedio']; $db = new ConnectionHandler("{$ruta_raiz}"); $db->conn->SetFetchMode(ADODB_FETCH_ASSOC); $eMailMid = $_SESSION['eMailMid']; //$db->conn->debug =true; //$sqlFechaHoy=$db->conn->query("select * from usuario"); $tmpNameEmail = $_SESSION['tmpNameEmail']; include "connectIMAP.php"; $chequeo = imap_mailboxmsginfo($buzonImap); echo "Mensajes antes de borrar: " . $chequeo->Nmsgs . "<br />\n"; echo "a Borrar {$eMailMid} "; imap_delete($buzonImap, $eMailMid); $chequeo = imap_mailboxmsginfo($buzonImap); echo "Mensajes después de borrar: " . $chequeo->Nmsgs . "<br />\n"; imap_expunge($buzonImap); $chequeo = imap_mailboxmsginfo($buzonImap); echo "Mensajes después de purgar: " . $chequeo->Nmsgs . "<br />\n"; imap_close($buzon); ?> <html> <head> <title>:: Confirmacion Borrado de Mail ::</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="../estilos_totales.css"> </head> <body bgcolor="#FFFFFF" text="#000000" topmargin="0"> Borrando el Correo Electronico . . .. <form method=post action="deleteMail.php??nurad=<?php echo $nurad; ?>
public static function getMailBoxmsgInfo($userid = false) { if ($userid) { $Accounts = self::get_account_detail($userid); } else { $Accounts = self::get_active_email_account(); } if (!$Accounts) { return false; } $mbox = self::imap_connect($Accounts[0]['username'], $Accounts[0]['password']); $mailboxmsginfo = imap_mailboxmsginfo($mbox); return $mailboxmsginfo; }
function pop3_stat($connection = false) { $connection = $this->getConnection($connection); $check = imap_mailboxmsginfo($connection); return (array) $check; }
/** * Method to check the status of a mailbox * Will return info like: * Number of unread mails * Number of new mails * Number of recent mails * number of total messages * Size in bytes * Date * Driver used * Mailbox used * etc... * * @access public * @param void * @return stdObject */ public function checkMailboxStatus() { $check = imap_mailboxmsginfo($this->conn); return $check; }
<?php // 必要な定数を設定 define('GMAIL_HOST', 'imap.googlemail.com'); define('GMAIL_PORT', 993); define('GMAIL_ACCOUNT', '*****@*****.**'); define('GMAIL_PASSWORD', 'tochikun'); define('SERVER', '{' . GMAIL_HOST . ':' . GMAIL_PORT . '/novalidate-cert/imap/ssl}'); // メールボックスへの IMAP ストリームをオープン if (($mbox = @imap_open(SERVER . "INBOX", GMAIL_ACCOUNT, GMAIL_PASSWORD)) == false) { } echo 'Hello'; // メールボックスの情報を取得 $mboxes = imap_mailboxmsginfo($mbox); echo 'Hello'; // メッセージ数の有無 if ($mboxes->Nmsgs != 0) { // 情報を格納する変数を初期化 $mail = null; for ($mailno = 1; $mailno <= $mboxes->Nmsgs; $mailno++) { // ヘッダー情報の取得 $head = imap_header($mbox, $mailno); // アドレスの取得 $mail[$mailno]['address'] = $head->from[0]->mailbox . '@' . $head->from[0]->host; // タイトルの有無 if (!empty($head->subject)) { // タイトルをデコード $mhead = imap_mime_header_decode($head->subject); foreach ($mhead as $key => $value) { if ($value->charset != 'default') { $mail[$mailno]['subject'] = mb_convert_encoding($value->text, 'UTF-8', $value->charset);
/** * Get information about the current mailbox. * * Returns an object with following properties: * Date - last change (current datetime) * Driver - driver * Mailbox - name of the mailbox * Nmsgs - number of messages * Recent - number of recent messages * Unread - number of unread messages * Deleted - number of deleted messages * Size - mailbox size * * @return object Object with info | FALSE on failure */ public function get_mailbox_info() { return imap_mailboxmsginfo($this->get_imap_stream()); }
function pop3_stat($connection) { $check = @imap_mailboxmsginfo($connection); return (array) $check; }
/** * Function to delete messages in a mailbox, based on date * NOTE: this is global ... will affect all mailboxes except any that have 'sent' in the mailbox name */ public function globalDelete() { $dateArr = split('-', $this->deleteMsgDate); // date format is yyyy-mm-dd $delDate = mktime(0, 0, 0, $dateArr[1], $dateArr[2], $dateArr[0]); $port = $this->port . '/' . $this->service . '/' . $this->serviceOption; $mboxt = imap_open('{' . $this->mailhost . ":" . $port . '}', $this->mailboxUserName, $this->mailboxPassword, OP_HALFOPEN); $list = imap_getmailboxes($mboxt, '{' . $this->mailhost . ":" . $port . '}', "*"); $mailboxFound = false; if (is_array($list)) { foreach ($list as $key => $val) { // get the mailbox name only $nameArr = split('}', imap_utf7_decode($val->name)); $nameRaw = $nameArr[count($nameArr) - 1]; if (!stristr($nameRaw, 'sent')) { $mboxd = imap_open('{' . $this->mailhost . ":" . $port . '}' . $nameRaw, $this->mailboxUserName, $this->mailboxPassword, CL_EXPUNGE); $messages = imap_sort($mboxd, SORTDATE, 0); $i = 0; $check = imap_mailboxmsginfo($mboxd); foreach ($messages as $message) { $header = imap_header($mboxd, $message); $fdate = date("F j, Y", $header->udate); // purge if prior to global delete date if ($header->udate < $delDate) { imap_delete($mboxd, $message); } $i++; } imap_expunge($mboxd); imap_close($mboxd); } } } }
function stats() { $this->stats = imap_mailboxmsginfo($this->connection); }
/** * @name: getmails * holt x Mails aus dem Postfach und parst diese nach Parts, oder sucht nur nach $subject * * @param $subject * @return Boolean */ public function getmails($subject = 0) { imap_expunge($this->connection); $check = imap_mailboxmsginfo($this->connection); if (isset($subject) && !empty($subject)) { $mails = imap_search($this->connection, 'UNSEEN SUBJECT "' . substr(urldecode(subject), 0, 45) . '"', SE_UID); } else { $mails[0] = '*'; } $mails = imap_fetch_overview($this->connection, "1:" . $mails[0], FT_UID); // Holt eine Uebersicht aller Emails $size = count($mails); // Anzahl der Nachrichten if ($size >= $this->config['counter']) { $size = $this->config['counter']; } for ($i = 0; $i < $size; $i++) { if ($i >= $this->config['counter']) { break; } $mails[$i]->subject = imap_utf8($mails[$i]->subject); $header = imap_fetchheader($this->connection, $mails[$i]->msgno); $struct = imap_fetchstructure($this->connection, $mails[$i]->msgno); $report = imap_fetchbody($this->connection, $mails[$i]->msgno, 2); $body = imap_fetchbody($this->connection, $mails[$i]->msgno, 1); $logs = imap_fetchbody($this->connection, $mails[$i]->msgno, 3); $this->mail[$i] = array('header' => $header, 'body' => $body, 'report' => $report, 'logs' => $logs, 'structur' => $struct, 'all' => $mails[$i]); $this->msgnr = $mails[$i]->msgno; if ($this->config['afterparse'] == 'delete') { imap_delete($this->connection, $mails[$i]->msgno . ':*'); } elseif ($this->config['afterparse'] == 'move') { imap_mail_move($this->connection, $mails[$i]->msgno, $config['ordner'] . '.' . $this->config['movebox']); } } if ($this->config['afterparse'] == 'delete_all') { imap_delete($this->connection, "*"); } imap_expunge($this->connection); if (!is_array($mails)) { $this->mail = 0; } return $this->mail; }
function mailboxmsginfo($stream) { return imap_mailboxmsginfo($stream); }
function getMailboxSize($mailbox, $formatted = true) { $this->changeMailbox($mailbox); $info = @imap_mailboxmsginfo($this->stream()); if ($info) { return $formatted ? sprintf(_("%.2fМб"), $info->Size / (1024 * 1024)) : $info->Size; } else { return 0; } }
/** * Return general mailbox statistics * * @return bool | StdClass object */ public function getMailboxStatistics() { return $this->isConnected() ? imap_mailboxmsginfo($this->imap) : false; }
/** * Get information about the current mailbox. * * Returns an object with following properties: * Date - last change (current datetime) * Driver - driver * Mailbox - name of the mailbox * Nmsgs - number of messages * Recent - number of recent messages * Unread - number of unread messages * Deleted - number of deleted messages * Size - mailbox size * * @return object Object with info | FALSE on failure */ public function getMailboxInfo() { return imap_mailboxmsginfo($this->getImapStream()); }
/** Returns Information about the current Path */ function pathStat() { $res = imap_mailboxmsginfo($this->_c); $ret = array('date' => $res->Date, 'path' => $res->Mailbox, 'mail_count' => $res->Nmsgs, 'size' => $res->Size); $res = imap_check($this->_c); $ret['check_date'] = $res->Date; $ret['check_mail_count'] = $res->Nmsgs; $ret['check_path'] = $res->Mailbox; // $ret = array_merge($ret,$res); return $ret; }
public static function updateMailBoxmsgInfo($users) { $log = vglobal('log'); $log->debug(__CLASS__ . ':' . __FUNCTION__ . ' - Start'); $adb = PearDatabase::getInstance(); if (count($users) == 0) { return FALSE; } $sUsers = implode(',', $users); $result = $adb->pquery("SELECT count(*) AS num FROM yetiforce_mail_quantities WHERE userid IN (?) AND status = 1;", [$sUsers]); if ($adb->query_result_raw($result, 0, 'num') > 0) { return FALSE; } $adb->pquery('UPDATE yetiforce_mail_quantities SET `status` = ? WHERE userid IN (' . $sUsers . ');', [1]); foreach ($users as $user) { $account = self::get_account_detail($user); if ($account !== FALSE) { $result = $adb->pquery("SELECT count(*) AS num FROM yetiforce_mail_quantities WHERE userid = ?;", [$user]); $mbox = self::imapConnect($account['username'], $account['password'], $account['mail_host'], 'INBOX', FALSE); if ($mbox) { $info = imap_mailboxmsginfo($mbox); if ($adb->query_result_raw($result, 0, 'num') > 0) { $adb->pquery('UPDATE yetiforce_mail_quantities SET `num` = ?,`status` = ? WHERE `userid` = ?;', [$info->Unread, 0, $user]); } else { $adb->pquery('INSERT INTO yetiforce_mail_quantities (`num`,`userid`) VALUES (?,?);', [$info->Unread, $user]); } } } } $log->debug(__CLASS__ . ':' . __FUNCTION__ . ' - End'); return TRUE; }
echo $val->msgno; ?> ]["cc"]="<?php echo addslashes($cc_list); ?> "; <?php } } echo "</script>"; $search_fields = array("SUBJECT", "BODY", "TO", "CC", "BCC", "FROM"); $listview_header = array("<th class='tableHeadBg' width='10%'>" . $mod_strings['LBL_INFO'] . "</th>", "<th class='tableHeadBg' width='45%'>" . $mod_strings['LBL_LIST_SUBJECT'] . "</th>", "<th class='tableHeadBg' width='25%'>" . $mod_strings['LABEL_DATE'] . "</th>", "<th class='tableHeadBg' width='10%'>" . $mod_strings['LABEL_FROM'] . "</th>", "<th class='tableHeadBg'>" . $mod_strings['LBL_DEL'] . "</th>"); $listview_entries = array(); $displayed_msgs = 0; $info = imap_mailboxmsginfo($MailBox->mbox); $unread_msgs = $info->Unread; //$new_msgs=0; if ($numEmails <= 0) { $listview_entries[0][] = '<td colspan="6" width="100%" align="center"><b>' . $mod_strings['LBL_NO_EMAILS'] . '</b></td>'; } else { if (isset($_REQUEST["search"]) && trim($_REQUEST["search_input"]) != '') { $searchstring = vtlib_purify($_REQUEST["search_type"]) . ' "' . vtlib_purify($_REQUEST["search_input"]) . '"'; //echo $searchstring."<br>"; $searchlist = array(); $searchlist = imap_search($MailBox->mbox, $searchstring); if (is_array($searchlist)) { $num_searches = count($searchlist); $c = $numEmails; } $search_count = $num_searches;