* for remote mailbox */ $bmh->mailhost = ''; // your mail server $bmh->mailbox_username = ''; // your mailbox username $bmh->mailbox_password = ''; // your mailbox password //$bmh->port = 143; // the port to access your mailbox, default is 143 //$bmh->service = 'imap'; // the service to use (imap or pop3), default is 'imap' //$bmh->service_option = 'notls'; // the service options (none, tls, notls, ssl, etc.), default is 'notls' //$bmh->boxname = 'INBOX'; // the mailbox to access, default is 'INBOX' //$bmh->moveHard = true; // default is false //$bmh->hardMailbox = 'INBOX.hardtest'; // default is 'INBOX.hard' - NOTE: must start with 'INBOX.' //$bmh->moveSoft = true; // default is false //$bmh->softMailbox = 'INBOX.softtest'; // default is 'INBOX.soft' - NOTE: must start with 'INBOX.' //$bmh->deleteMsgDate = '2009-01-05'; // format must be as 'yyyy-mm-dd' /* * rest used regardless what type of connection it is */ $bmh->openMailbox(); $bmh->processMailbox(); echo '<hr style="width:200px;" />'; $time_end = microtime_float(); $time = $time_end - $time_start; echo "Seconds to process: " . $time . "<br />"; function microtime_float() { list($usec, $sec) = explode(" ", microtime()); return (double) $usec + (double) $sec; }
if ($expr != '') { $expr .= ','; } $expr .= '`' . $v . '` = :' . $v; } $sql = 'INSERT INTO ' . LOG_BOUNCES_TABLE . ' SET ' . $expr . ' ON DUPLICATE KEY UPDATE dateinsert=NOW()'; //print $sql; $logquery = $db->prepare($sql); foreach (array_keys($params) as $v) { $logquery->bindParam(':' . $v, $params[$v]); } $logquery->execute(); // $error = $logquery->errorInfo(); // if ($error[0] != '00000') print_r($arr); } // objet BounceMailHandler $bmh = new BounceMailHandler(); // en mode test if ($testsend) { $bmh->testmode = true; // si on veux les corps de message //$bmh->debug_body_rule=true; //$bmh->debug_dsn_rule=true; // niveau de debug //$bmh->verbose=VERBOSE_DEBUG; } $bmh->action_function = 'bounceActionClean'; $bmh->log_bounces_function = 'logBounces'; $bmh->openPop3(BOUNCE_SERVER, BOUNCE_USER, BOUNCE_PASS); $bmh->processMailbox(BOUNCE_NB);