} //unread increment if (!$mail_unseen->date_read) { $unread++; } //read on server + pref + not sent => archived ! if ($mail_unseen->date_read && $archivedOnReception && !$mail_unseen->sent) { $mail_unseen->archived = 1; } //store the usermail if (!($msg = $mail_unseen->store())) { $created++; } //attachments list $pop->cleanTemp(); $attachs = $pop->getListAttachments($_mail); $mail_unseen->attachFiles($attachs, $pop); } else { // si le mail est lu sur MB mais non lu sur IMAP => on le flag if ($mail_unseen->date_read) { $pop->setflag($_mail, "\\Seen"); } } $loop++; } //foreach //set email as read in imap/pop server if ($markReadServer) { $pop->setFlag(implode(",", $unseen), "\\Seen"); } //number of mails gathered
//client POP $clientPOP = new CSourcePOP(); $clientPOP->load($mail->account_id); $pop = new CPop($clientPOP); if (!$pop->open()) { return; } //overview $overview = $pop->header($mail->uid); $msgno = $overview->msgno; $infos = $pop->infos($msgno); //structure $structure = $pop->structure($mail->uid); //content $content = $pop->getFullBody($mail->uid); //attachments $attachments = array(); $_attachments = $pop->getListAttachments($mail->uid); foreach ($_attachments as $_attach) { $attachments[] = $_attach->getPlainFields(); } $pop->close(); $smarty = new CSmartyDP(); $smarty->assign("mail", $mail); $smarty->assign("overview", $overview); $smarty->assign("structure", $structure); $smarty->assign("mail_id", $mail_id); $smarty->assign("content", $content); $smarty->assign("attachments", $attachments); $smarty->assign("infos", $infos); $smarty->display("vw_pop_mail.tpl");