Example #1
0
            }
        }
    }
    // mark e-mail for deletion
    imap_delete($mbox, $msgno);
}
chdir('..');
include_once 'etc/commsy/development.php';
include_once 'classes/cs_mail.php';
include_once 'functions/curl_functions.php';
// setup commsy-environment
include_once 'etc/cs_constants.php';
include_once 'etc/cs_config.php';
include_once 'classes/cs_environment.php';
$environment = new cs_environment();
$environment->setCacheOff();
$server_item = $environment->getServerItem();
$portal_id_array = $server_item->getPortalIDArray();
// open connection
$options = $environment->getConfiguration('c_email_upload_server_options');
if (!isset($options)) {
    $options = '';
}
$mbox = imap_open('{' . $c_email_upload_server . ':' . $c_email_upload_server_port . $options . '}', $c_email_upload_email_account, $c_email_upload_email_password);
if (!empty($mbox)) {
    // get and process e-mails
    $message_count = imap_num_msg($mbox);
    for ($msgno = 1; $msgno <= $message_count; ++$msgno) {
        email_to_commsy($mbox, $msgno);
    }
    #echo('email: '.$message_count.LF);