<?php
include_once('framework/language.php');
function sendmail() {
$goto = $forum;
$autoforward = 5;
$datenow = date('d.m.Y H:i');
$senderip = $_SERVER["REMOTE_ADDR"];
$to = htmlentities($_POST["to"]);
$name = isset($_POST["name"]) ? htmlentities($_POST["name"]) : "";
$from = isset($_POST["from"]) ? htmlentities($_POST["from"]) : "";
$homepage = isset($_POST["homepage"]) ? htmlentities($_POST["homepage"]) : "http://";
$reason = isset($_POST["reason"]) ? htmlentities($_POST["reason"]) : "";
$text = isset($_POST["text"]) ? htmlentities($_POST["text"]) : "";
$mailto = $to;
$mailfrom = $from;
$subject = $reason;
$message = '' . $lang['sent_on'] . ': ' . $datenow . ' | IP: ' . $senderip . '
----------------------------------------------------------------------
Name: ' . $name . '
E-Mail: ' . $mailfrom . '
Homepage: ' . $homepage . '
' . $lang['subject'] . ': ' . $subject . '
' . $lang['message'] . ': ' . $text . '
----------------------------------------------------------------------
' . $lang['sendet_by'] . '
';
$headers = 'From:' . $mailfrom . '';
if(mail($mailto, $subject, $message, $headers)) {
echo '<br><p class="right">' . $lang['sendmail_success'] . '</p>
<meta http-equiv="refresh" content="' . $autoforward . '; URL=' . $goto . '">
<p><em>(' . $lang['redirected_in'] . ' ' . $autoforward . ' ' . $lang['seconds'] . '...)</em><p><br>';
}else{
echo '<br><p class="false">' . $lang['sendmail_failed'] . '</p>';
}
}
?>