本文整理汇总了PHP中Support::getTotalEmails方法的典型用法代码示例。如果您正苦于以下问题:PHP Support::getTotalEmails方法的具体用法?PHP Support::getTotalEmails怎么用?PHP Support::getTotalEmails使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Support
的用法示例。
在下文中一共展示了Support::getTotalEmails方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cleanup_lock
// clear the lock in all cases of termination
function cleanup_lock()
{
global $account_id;
Lock::release('download_emails_' . $account_id);
}
register_shutdown_function('cleanup_lock');
$account = Email_Account::getDetails($account_id);
$mbox = Support::connectEmailServer($account);
if ($mbox == false) {
$uri = Support::getServerURI($account);
$login = $account['ema_username'];
$error = imap_last_error();
fatal("{$error}\n", "Could not connect to the email server '{$uri}' with login: '{$login}'.", 'Please verify your email account settings and try again.');
}
// if we only want new emails
if ($account['ema_get_only_new']) {
$new_emails = Support::getNewEmails($mbox);
foreach ($new_emails as $new_email) {
Support::getEmailInfo($mbox, $account, $new_email);
}
} else {
$total_emails = Support::getTotalEmails($mbox);
if ($total_emails > 0) {
for ($i = 1; $i <= $total_emails; $i++) {
Support::getEmailInfo($mbox, $account, $i);
}
}
}
Support::closeEmailServer($mbox);
Support::clearErrors();