<?php
include(dirname(__FILE__)."/require.php");
if($ppurview[26]!=1)
  jump("jump.php?id=25&jump=main.php");
if(isset($_GET['action']) and $_GET['action'] == "submit")
{
  if($core_stmpopen==0)
    $_POST['email_eopen']=0;
  $str = "<?php\n";
  foreach($_POST AS $key=>$val)
  {
	$val=html_replacef($val);
    $str.= "$".$key."=\"".$val."\";\n";
  }
  $str.= "?>";
  $filename='../configs/email.php';
  @chmod($filename,0777);
  if (is_writable($filename)) 
  {
    if (!$handle=fopen($filename,'w') or fwrite($handle, $str) === FALSE)
      Header("Location: jump.php?id=error&jump=automess.php");
	else
	  Header("Location: jump.php?id=24&jump=automess.php");
	fclose($handle);
	exit();
  } 
  jump("jump.php?id=13&jump=automess.php");
  exit();
}
$tpl -> assign("email_addresser", $email_addresser);
$tpl -> assign("email_mopen", $email_mopen);
$tpl -> assign("email_eopen", $email_eopen);
$tpl -> assign("email_bzyest", $email_bzyest);
$tpl -> assign("email_bzyesc", $email_bzyesc);
$tpl -> assign("email_bznot", $email_bznot);
$tpl -> assign("email_bznoc", $email_bznoc); 
$tpl -> assign("email_cbzyest", $email_cbzyest);
$tpl -> assign("email_cbzyesc", $email_cbzyesc);
$tpl -> assign("email_cbznot", $email_cbznot);
$tpl -> assign("email_cbznoc", $email_cbznoc);
$tpl -> assign("email_flyest", $email_flyest);
$tpl -> assign("email_flyesc", $email_flyesc);
$tpl -> assign("email_flnot", $email_flnot);
$tpl -> assign("email_flnoc", $email_flnoc);
$tpl -> assign("email_tzhf", $email_tzhf);
$tpl -> assign("email_tzhfc", $email_tzhfc);
$tpl -> assign("email_fsyh", $email_fsyh);
$tpl -> assign("email_fsyhc", $email_fsyhc);
$tpl -> display("automess.htm");
?>