* @subpackage messagerie
 * @version    $Revision$
 * @author     SARL OpenXtrem
 */
CCanDo::checkRead();
$mail_id = CValue::get("mail_id", 0);
$pat_id = CValue::get("pat_id");
//apicrypt & search
$patient = new CPatient();
$dossier = new CSejour();
//looking for apicrypt => patient
$mail = new CUserMail();
$mail->load($mail_id);
$mail->loadContentPlain();
$mail->checkHprim();
$mail->checkApicrypt();
//apicrypt case
if ($mail->_is_apicrypt || $mail->_is_hprim) {
    $lines = explode("\n", $mail->_text_plain->content);
    $fl = $lines[0] != "[apicrypt]" ? 0 : 1;
    //first line
    //cleanup line 1 to 13
    for ($a = $fl; $a < $fl + 12; $a++) {
        $lines[$a] = trim($lines[$a]);
    }
    //init
    $ipp = $lines[$fl];
    $nom = $lines[$fl + 1];
    $prenom = $lines[$fl + 2];
    $addr = $lines[$fl + 3];
    $addr_2 = $lines[$fl + 4];