$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(); $text = $text->sanitizeHTML($mail->_text_html); //cleanup $textH->content = $text; if ($msg = $textH->store()) { CAppUI::setMsg($msg, UI_MSG_ERROR); } else { $mail->text_html_id = $textH->_id; } } $msg = $mail->store(); if ($msg) { CAppUI::setMsg($msg, UI_MSG_ERROR); } } $mail->loadRefsFwd(); $pop->close(); //Smarty $smarty = new CSmartyDP(); $smarty->assign("mail", $mail); $smarty->display("ajax_open_pop_email.tpl");