本文整理汇总了PHP中imap_clearflag_full函数的典型用法代码示例。如果您正苦于以下问题:PHP imap_clearflag_full函数的具体用法?PHP imap_clearflag_full怎么用?PHP imap_clearflag_full使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了imap_clearflag_full函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unreadMessages
function unreadMessages($messages)
{
$mbox = getMbox();
$messages = uidToSecuence($mbox, $messages);
imap_clearflag_full($mbox, $messages, '\\Seen');
imap_close($mbox);
}
示例2: unFlag
public function unFlag($flag)
{
return imap_clearflag_full($this->ImapFolder->Imap->stream, $this->uid, $flag, ST_UID);
}
示例3: processAllEmails
function processAllEmails($mailbox, $emails, $rucReceptor)
{
$returnArray = array("status" => true, "html" => "");
$handlerUserCore = new UserCore();
rsort($emails);
$returnArray["html"] .= ' <table class="table table-condensed table-striped">
<thead>
<tr>
<th>ID</th>
<th>Remitente</th>
<th>Fecha</th>
<th>Docs.</th>
<th>Estado</th>
<th>Proc.</th>
</tr>
</thead>
<tbody>';
foreach ($emails as $email_number) {
$status = '';
// Traer datos generales de e-mail
$overview = imap_fetch_overview($mailbox, $email_number, 0);
//$message = imap_fetchbody($mailbox, $email_number, 2);
$structure = imap_fetchstructure($mailbox, $email_number);
$attachments = getEmailAttachments($mailbox, $email_number, $structure);
$returnArray["html"] .= '<tr>';
$returnArray["html"] .= '<td style="font-size: 11px;">' . $email_number . '</td>';
$returnArray["html"] .= '<td style="font-size: 11px;">' . $overview[0]->from . '</td>';
$returnArray["html"] .= '<td style="font-size: 11px;">' . date("Y-m-d", strtotime($overview[0]->date)) . '</td>';
$returnArray["html"] .= '<td style="font-size: 11px;">' . count($attachments) . '</td>';
$status .= '<ul class="pointmark" style="margin: 0px;">';
if (count($attachments) > 0) {
// Leer cada adjunto XML y procesarlo
foreach ($attachments as $attachment) {
if (strtolower($attachment["xml_extension"]) == "xml") {
$validArray = processXmlString($attachment["xml_attachment"], $attachment["pdf_attachment"], $attachment["pdf_extension"], $rucReceptor, $attachment["xml_basename"]);
$processed = $validArray["status"];
}
if ($processed) {
$status .= "<li>Adjunto XML (" . $attachment["xml_basename"] . "): Procesado con éxito</li>";
} else {
$status .= "<li>" . $validArray["html"] . "</li>";
}
}
} else {
$status .= "<li>E-mail no tiene adjuntos</li>";
$processed = false;
$usuarioDefault = FlowSettingsCore::get(FLOW_RECEPCIONDOCUMENTOS, "RDE_DEF_ASIGNACION");
$usuarioData = $handlerUserCore->getUserData($usuarioDefault);
$email = $usuarioData["user_email"];
$html = 'Estimado usuario<br /><br />
Le informamos que tiene un nuevo documento electrónico descargable en el buzón. Por favor ingrese a revisarlo y darle tratamiento';
MailController::sendGeneralMail([["email" => $email]], "Nuevo documento electrónico descargable", $html);
}
$status .= '</ul>';
if (FlowSettingsCore::get(FLOW_RECEPCIONDOCUMENTOS, "RDE_MC_PRUEBAS") != "1") {
setEmailRead($email_number, $rucReceptor);
} else {
imap_clearflag_full($mailbox, $email_number, "\\Seen");
}
$returnArray["html"] .= '<td style="font-size: 11px;">' . $status . '</td>';
if ($processed) {
$returnArray["html"] .= '<td><span class="awe-ok" style="color: #6b9b20;"></span></td>';
} else {
$returnArray["html"] .= '<td><span class="awe-remove" style="color: #d43f3f;"></span></td>';
}
$returnArray["html"] .= '</tr>';
}
$returnArray["html"] .= "</table>";
return $returnArray;
}
示例4: flagMessages
function flagMessages($flag, $aMessagesUID)
{
if (empty($aMessagesUID)) {
return false;
}
reset($aMessagesUID);
$msglist = '';
while (list($key, $value) = each($aMessagesUID)) {
if (!empty($msglist)) {
$msglist .= ",";
}
$msglist .= $value;
}
switch ($flag) {
case "flagged":
$result = imap_setflag_full($this->stream(), $msglist, "\\Flagged", ST_UID);
break;
case "read":
$result = imap_setflag_full($this->stream(), $msglist, "\\Seen", ST_UID);
break;
case "answered":
$result = imap_setflag_full($this->stream(), $msglist, "\\Answered", ST_UID);
break;
case "unflagged":
$result = imap_clearflag_full($this->stream(), $msglist, "\\Flagged", ST_UID);
break;
case "unread":
$result = imap_clearflag_full($this->stream(), $msglist, "\\Seen", ST_UID);
$result = imap_clearflag_full($this->stream(), $msglist, "\\Answered", ST_UID);
break;
}
return $result;
}
示例5: setFlag
/**
* This function is used to enable or disable one or more flags on the imap message.
*
* @param string|array $flag Flagged, Answered, Deleted, Seen, Draft
* @param bool $enable
* @throws \InvalidArgumentException
* @return bool
*/
public function setFlag($flag, $enable = true)
{
$flags = is_array($flag) ? $flag : array($flag);
foreach ($flags as $i => $flag) {
$flag = ltrim(strtolower($flag), '\\');
if (!in_array($flag, self::$flagTypes) || $flag == self::FLAG_RECENT) {
throw new \InvalidArgumentException('Unable to set invalid flag "' . $flag . '"');
}
if ($enable) {
$this->status[$flag] = true;
} else {
unset($this->status[$flag]);
}
$flags[$i] = $flag;
}
$imapifiedFlag = '\\' . implode(' \\', array_map('ucfirst', $flags));
if ($enable === true) {
return imap_setflag_full($this->imapStream, $this->uid, $imapifiedFlag, ST_UID);
} else {
return imap_clearflag_full($this->imapStream, $this->uid, $imapifiedFlag, ST_UID);
}
}
示例6: mailcwp_mark_unread_callback
function mailcwp_mark_unread_callback()
{
$mailcwp_session = mailcwp_get_session();
if (!isset($mailcwp_session) || empty($mailcwp_session)) {
return;
}
$account = $mailcwp_session["account"];
//$from = $account["email"];
$folder = $mailcwp_session["folder"];
$messages = $_POST["messages"];
$mbox = mailcwp_imap_connect($account, 0, $folder);
imap_clearflag_full($mbox, $messages, "\\Seen");
//mailcwp_get_unseen_messages($account);
//write_log(print_r(imap_errors(), true));
echo json_encode(array("result" => "OK"));
die;
}
示例7: markMailUnread
/**
* Marks the mail as Unread
* @param <String> $msgno - Message Number
*/
function markMailUnread($msgno)
{
imap_clearflag_full($this->mBox, $msgno, '\\Seen');
$this->mModified = true;
}
示例8: MoveMessage
/**
* Called when the user moves an item on the PDA from one folder to another
*
* @param string $folderid id of the source folder
* @param string $id id of the message
* @param string $newfolderid id of the destination folder
* @param ContentParameters $contentparameters
*
* @access public
* @return boolean status of the operation
* @throws StatusException could throw specific SYNC_MOVEITEMSSTATUS_* exceptions
*/
public function MoveMessage($folderid, $id, $newfolderid, $contentparameters)
{
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->MoveMessage('%s','%s','%s')", $folderid, $id, $newfolderid));
$folderImapid = $this->getImapIdFromFolderId($folderid);
$newfolderImapid = $this->getImapIdFromFolderId($newfolderid);
if ($folderImapid == $newfolderImapid) {
throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, destination folder is source folder. Canceling the move.", $folderid, $id, $newfolderid), SYNC_MOVEITEMSSTATUS_SAMESOURCEANDDEST);
}
$this->imap_reopen_folder($folderImapid);
if ($this->imap_inside_cutoffdate(Utils::GetCutOffDate($contentparameters->GetFilterType()), $id)) {
// read message flags
$overview = @imap_fetch_overview($this->mbox, $id, FT_UID);
if (!is_array($overview)) {
throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, unable to retrieve overview of source message: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_INVALIDSOURCEID);
} else {
// get next UID for destination folder
// when moving a message we have to announce through ActiveSync the new messageID in the
// destination folder. This is a "guessing" mechanism as IMAP does not inform that value.
// when lots of simultaneous operations happen in the destination folder this could fail.
// in the worst case the moved message is displayed twice on the mobile.
$destStatus = imap_status($this->mbox, $this->server . $newfolderImapid, SA_ALL);
if (!$destStatus) {
throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, unable to open destination folder: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_INVALIDDESTID);
}
$newid = $destStatus->uidnext;
// move message
$s1 = imap_mail_move($this->mbox, $id, $newfolderImapid, CP_UID);
if (!$s1) {
throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, copy to destination folder failed: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_CANNOTMOVE);
}
// delete message in from-folder
$s2 = imap_expunge($this->mbox);
// open new folder
$stat = $this->imap_reopen_folder($newfolderImapid);
if (!$stat) {
throw new StatusException(sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): Error, opening the destination folder: %s", $folderid, $id, $newfolderid, imap_last_error()), SYNC_MOVEITEMSSTATUS_CANNOTMOVE);
}
// remove all flags
$s3 = @imap_clearflag_full($this->mbox, $newid, "\\Seen \\Answered \\Flagged \\Deleted \\Draft", FT_UID);
$newflags = "";
$move_to_trash = strcasecmp($newfolderImapid, $this->create_name_folder(IMAP_FOLDER_TRASH)) == 0;
if ($overview[0]->seen || $move_to_trash && defined('IMAP_AUTOSEEN_ON_DELETE') && IMAP_AUTOSEEN_ON_DELETE == true) {
$newflags .= "\\Seen";
}
if ($overview[0]->flagged) {
$newflags .= " \\Flagged";
}
if ($overview[0]->answered) {
$newflags .= " \\Answered";
}
$s4 = @imap_setflag_full($this->mbox, $newid, $newflags, FT_UID);
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->MoveMessage('%s','%s','%s'): result s-move: '%s' s-expunge: '%s' unset-Flags: '%s' set-Flags: '%s'", $folderid, $id, $newfolderid, Utils::PrintAsString($s1), Utils::PrintAsString($s2), Utils::PrintAsString($s3), Utils::PrintAsString($s4)));
// return the new id "as string"
return $newid . "";
}
} else {
throw new StatusException(sprintf("BackendIMAP->MoveMessage(): Message is outside the sync range"), SYNC_MOVEITEMSSTATUS_INVALIDSOURCEID);
}
}
示例9: set_flag
/**
* This function is used to enable or disable a flag on the imap message.
*
* @param string $flag Flagged, Answered, Deleted, Seen, Draft
* @param bool $enable
* @return bool
*/
public function set_flag($flag, $enable = TRUE)
{
if (!in_array($flag, self::$flag_types) or $flag == 'recent') {
throw new Imap_Exception('Unable to set invalid flag "' . $flag . '"');
}
$flag = '\\' . ucfirst($flag);
if ($enable) {
return imap_setflag_full($this->imap_stream, $this->uid, $flag, ST_UID);
} else {
return imap_clearflag_full($this->imap_stream, $this->uid, $flag, ST_UID);
}
}
示例10: flagMessages
function flagMessages($_flag, $_messageUID)
{
reset($_messageUID);
while (list($key, $value) = each($_messageUID)) {
if (!empty($msglist)) {
$msglist .= ",";
}
$msglist .= $value;
}
switch ($_flag) {
case "flagged":
$result = imap_setflag_full($this->mbox, $msglist, "\\Flagged", ST_UID);
break;
case "read":
$result = imap_setflag_full($this->mbox, $msglist, "\\Seen", ST_UID);
break;
case "answered":
$result = imap_setflag_full($this->mbox, $msglist, "\\Answered", ST_UID);
break;
case "unflagged":
$result = imap_clearflag_full($this->mbox, $msglist, "\\Flagged", ST_UID);
break;
case "unread":
$result = imap_clearflag_full($this->mbox, $msglist, "\\Seen", ST_UID);
$result = imap_clearflag_full($this->mbox, $msglist, "\\Answered", ST_UID);
break;
}
#print "Result: $result<br>";
}
示例11: join
/*
print $seq;
print $_POST["moveto"];
print $res;
*/
} else {
if ($act == "flags") {
if (isset($_POST["msgmark"])) {
$seq = join(",", array_keys($_POST["msgmark"]));
}
$flag = $_POST["flag"];
if ("read" == $flag) {
imap_setflag_full($mbox, $seq, "\\Seen", ST_UID);
}
if ("unread" == $flag) {
imap_clearflag_full($mbox, $seq, "\\Seen", ST_UID);
}
print "[\n";
if (isset($_REQUEST["msgids"])) {
$ovr = imap_fetch_overview($mbox, $_REQUEST["msgids"], FT_UID);
foreach ($ovr as $mkey => $msgobj) {
printf("{'type': 'mflag', 'msgid': '%d', 'seen': %d, 'answered': %d},\n", $msgobj->uid, $msgobj->seen, $msgobj->answered);
}
}
$mboxinf = imap_status($mbox, $mboxspec, SA_ALL);
$msg_total = $mboxinf->messages;
$msg_unread = $mboxinf->unseen;
printf("{'type': 'mbox', 'caption': '%s', 'name': '%s', 'total': %d, 'unread': %d},\n", get_folder_caption($mailbox), $mailbox, $msg_total, $msg_unread);
print "];";
// edasi .. see asi peab tagastama packeti iga mailboxis olnud kirja kohta, sest mõni neist võib olla
// muutunud loetuks mõnel muul moel .. s.t. siis query_server peab tagastama kõik kirjad,
示例12: setFlags
/**
* Wrapper function for {@link imap_setflag_full}. Sets various message flags.
* Accepts an array of message ids and an array of flags to be set.
*
* The flags which you can set are "\\Seen", "\\Answered", "\\Flagged",
* "\\Deleted", and "\\Draft" (as defined by RFC2060).
*
* Warning: POP3 mailboxes do not remember flag settings from connection to connection.
*
* @param array $mids Array of message ids to set flags on.
* @param array $flags Array of flags to set on messages.
* @param int $action Flag operation toggle one of MAIL_IMAP_SET_FLAGS (default) or
* MAIL_IMAP_CLEAR_FLAGS.
* @param int $options
* (optional) sets the forth argument of {@link imap_setflag_full} or {@imap_clearflag_full}.
*
* @return BOOL|PEAR_Error
* @throws Message IDs and Flags are to be supplied as arrays. Remedy: place message ids
* and flags in arrays.
* @access public
* @see imap_setflag_full
* @see imap_clearflag_full
*/
function setFlags($mids, $flags, $action = 3, $options = NULL)
{
if (is_array($mids) && is_array($flags)) {
if ($action == MAIL_IMAP_SET_FLAGS) {
if (isset($this->option['setflag_full'])) {
$options = $this->option['setflag_full'];
}
return @imap_setflag_full($this->mailbox, implode(',', $mids), implode(' ', $flags), $options);
} else {
if (isset($this->option['clearflag_full'])) {
$options = $this->option['clearflag_full'];
}
return @imap_clearflag_full($this->mailbox, implode(',', $mids), implode(' ', $flags), $options);
}
} else {
return PEAR::raiseError('Mail_IMAP::setFlags: First and second arguments must be arrays.');
}
}
示例13: mail_SetFlag
function mail_SetFlag($conn, $mail, $flag)
{
switch ($flag) {
case 'Seen':
return @imap_setflag_full($conn, $mail, "\\Seen", SE_UID);
break;
case 'Unseen':
return @imap_clearflag_full($conn, $mail, "\\Seen", SE_UID);
break;
case 'Flagged':
return @imap_setflag_full($conn, $mail, "\\Flagged", SE_UID);
break;
case 'Unflagged':
return @imap_clearflag_full($conn, $mail, "\\Flagged", SE_UID);
break;
case 'Delete':
mail_dele($conn, $mail);
break;
case 'Draft':
return @imap_setflag_full($conn, $mail, "\\Draft", SE_UID);
break;
case 'Answerd':
return @imap_setflag_full($conn, $mail, "\\Answered", SE_UID);
break;
default:
return false;
}
}
示例14: clearFLag
public function clearFLag($str, $list)
{
if (empty($list) || gettype($list) != 'array') {
return 'Nieprawidłowy format danych wejsciowych';
}
$xy = implode(",", $list);
imap_clearflag_full($this->mbox, $xy, $str, ST_UID);
}
示例15: removeFlagMessagesFilter
/**
* Remove a flag que caracteriza uma mensagem como alertada por Filtro por Remetente.
* se houver o parametro msg_number, então remove a flag de uma msg especifica
* se não houver o parametro msg_number, mas sim o from, então remove a flag de todas as msgs da pasta (parametro from),
* e que o remetente for o from.
*/
function removeFlagMessagesFilter($params)
{
$message_number = $params['msg_number'];
$folder = $params['folder'];
if (isset($message_number)) {
if (isset($folder)) {
$message_number = explode(',', $message_number);
$this->mbox = $this->open_mbox($folder);
foreach ($message_number as $k => $m) {
imap_clearflag_full($this->mbox, $m, '$FilteredMessage', ST_UID);
}
}
} else {
$from = $params['from'];
if (isset($folder) && isset($from)) {
$this->mbox = $this->open_mbox($folder);
$messages = imap_search($this->mbox, 'UNDELETED UNSEEN KEYWORD "$FilteredMessage"', SE_UID);
}
if (is_array($messages)) {
foreach ($messages as $k => $m) {
$headers = imap_fetch_overview($this->mbox, $m, FT_UID);
if (strpos($headers[0]->from, $from) > 0) {
imap_clearflag_full($this->mbox, $m, '$FilteredMessage', ST_UID);
}
}
}
}
return array('status' => "success");
}