<?PHP include("./../function/timestamp.inc.php");?>

<div class="animated fadeInDown2">

<div class="box-body">
<div class="padd-lr10">

<div class='clearX infoboxline'></div>
<div class='ph15'></div>

<?PHP 
include("./../".$SYSD."/mails/mailing.inc.php");
$messageT=file_get_contents("../".$SYSD."/mails/mailingtext.inc.php");
$messageS=file_get_contents("../".$SYSD."/mails/mailing-signatur.inc.php");
$messageX=$messageT.$messageS."<br><br>";

$header="MIME-Version: 1.0\n";
$header.="Content-type: text/html; charset=windows-1252\n";
$header.="FROM: ".$sendfrom."\n";

$send1=mail($sendto,$sendsubject,$messageX,$header, '-f $sendto');  //Mail to
$send2=mail($sendfrom,$sendsubject,$messageX,$header, '-f $sendfrom');  //Mail from

$timeX=$timestamp;
$timeZ=$timestampZ;
$mailContent1="<?PHP 
\$sendfrom='$sendfrom';
\$sendto='$sendto';
\$sendsubject='$sendsubject';
\$senddate='$timeZ';
?>";
$mailSave1="./../".$SYSD."/messages-out/mail-".$timeX.".inc.php";
$handle=fopen($mailSave1, "w");
fwrite($handle,$mailContent1);
fclose($handle);
$oldumask = umask(0);
chmod($mailSave1, 0644);
umask($oldumask);

$mailSave2="./../".$SYSD."/messages-out/mail-".$timeX."t.inc.php";
$handle=fopen($mailSave2, "w");
fwrite($handle,$messageX);
fclose($handle);
$oldumask = umask(0);
chmod($mailSave2, 0644);
umask($oldumask);

unlink("./../".$SYSD."/mails/mailing.inc.php");
unlink("./../".$SYSD."/mails/mailingtext.inc.php");
copy("./../".$SYSI."/".$SYSD."/mailing.inc.php" , "./../".$SYSD."/mails/mailing.inc.php");
copy("./../".$SYSI."/".$SYSD."/mailingtext.inc.php" , "./../".$SYSD."/mails/mailingtext.inc.php");

// SAVEINFO
$savedateX=time();
$saveData="<?PHP 
\$savedateX='$savedateX';
\$sendto='$sendto';
\$senddate='$timeZ';
?>";
$saveFile="./../tmp/saveinfo-".$filename1."-".$vlink.".inc.php";
$handle=fopen($saveFile, "w");
fwrite($handle,$saveData);
fclose($handle);
$oldumask = umask(0);
chmod($saveFile, 0644);
umask($oldumask);

echo "<span class='resT'>".$messagedata11."  (".$timestampZ.")</span>";

include("./../function/forward-s-e.inc.php");
include("./../function/autoX.inc.php");
echo "
<br>
<br>
<a href='$elink'>
<div class='vlinkS'>
<i class='hvL fa fa-arrow-circle-right padd-right5'></i>
<span class='hvS'>".$back1."</span>
</div>
</a>
";
?>

</div><!-- padd -->
</div><!-- End box-body -->

<div class="clearX box-footer"></div>

</div><!-- End animated -->
