} if (!$mail_id) { CAppUI::stepAjax("CSourcePOP-error-mail_id", UI_MSG_ERROR); } //pop init $pop = new CPop($log_pop); $pop->open(); //mail $mail = new CUserMail(); $head = $pop->header($mail_id); $content = $pop->getFullBody($_mail, false, false, true); $hash = $mail_unseen->makeHash($head, $content); $mail->loadMatchingFromHash($hash); if ($mail->_id && !$mail->text_plain_id) { $mail->setHeaderFromSource($head); $mail->setContentFromSource($pop->getFullBody($_mail, false, false, true)); $mail->date_read = CMbDT::dateTime(); $mail->user_id = $user->_id; //text plain if ($mail->_text_plain) { $textP = new CContentAny(); $textP->content = $mail->_text_plain; if ($msg = $textP->store()) { CAppUI::setMsg($msg, UI_MSG_ERROR); } $mail->text_plain_id = $textP->_id; } //text html if ($mail->_text_html) { $textH = new CContentHTML(); $text = new CMbXMLDocument();