0 ) { $page['formemail'] = $mail; $page['ct.chatThreadId'] = $thread['threadid']; $page['ct.token'] = $thread['ltoken']; $page['level'] = ""; start_html_output(); require('view/chat_mailthread.php'); exit; } $history = ""; $lastid = -1; $output = get_messages( $threadid,"text",true,$lastid ); foreach( $output as $msg ) { $history .= $msg; } $subject = getstring("mail.user.history.subject"); $body = getstring2("mail.user.history.body", array($thread['userName'],$history) ); $headers = 'From: '.$webim_from_email."\r\n" . 'Reply-To: '.$webim_from_email."\r\n" . 'X-Mailer: PHP/'.phpversion(); mail($mail,$subject,wordwrap($body,70),$headers); start_html_output(); require('view/chat_mailsent.php'); ?>