Esempio n. 1
0
 * 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;
}
Esempio n. 2
0
        <li><?php 
echo "BMH mail username - {$bmh_mailbox_username}";
?>
</li>
        <li><?php 
$dirTmp = getcwd();
// define the "base" directory of the application
if (!defined('_PATH_BMH')) {
    $dirTmp = $_SERVER['DOCUMENT_ROOT'] . '/' . $dirTmp;
    if (strlen(substr($dirTmp, strlen($_SERVER['DOCUMENT_ROOT']) + 1)) > 0) {
        define('_PATH_BMH', substr($dirTmp, strlen($_SERVER['DOCUMENT_ROOT']) + 1) . "/bmh/");
    } else {
        define('_PATH_BMH', '');
    }
}
include _PATH_BMH . 'class.phpmailer-bmh.php';
$bmh = new BounceMailHandler();
$bmh->mailhost = $bmh_mailhost;
$bmh->mailbox_username = $bmh_mailbox_username;
$bmh->mailbox_password = $bmh_mailbox_password;
$bmh->port = $bmh_port;
$bmh->service = $bmh_service;
$bmh->service_option = $bmh_service_option;
$bmh->boxname = $bmh_boxname;
$bmh->verbose = VERBOSE_QUIET;
if ($bmh->openMailbox()) {
    echo "BMH mailbox succesfully opened.";
    imap_close($bmh->_mailbox_link);
} else {
    echo "BMH mailbox could not be opened. Please verify the settings.";
}