Initial commit
This commit is contained in:
77
mail.php
Normal file
77
mail.php
Normal file
@ -0,0 +1,77 @@
|
||||
<?php
|
||||
/*
|
||||
# Fuer debugging
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
#echo __LINE__."<br>";
|
||||
*/
|
||||
|
||||
include_once 'classes/lg-on_Smarty.class.php';
|
||||
$smarty = new lgon_Smarty();
|
||||
require_once("config.inc.php");
|
||||
$templatename = substr(basename($_SERVER['PHP_SELF']),0,-3)."html";
|
||||
require_once "language/german.inc.php";
|
||||
|
||||
if(isset($_GET['action'])){
|
||||
$action = $_GET['action'];
|
||||
}else{
|
||||
$action = '';
|
||||
}
|
||||
if($action == ''){
|
||||
|
||||
$db = dbconnect();
|
||||
$empf = $db->query("SELECT vorname, nachname, mail FROM admin WHERE user='$user_admin'");
|
||||
$row_empf = $empf->fetch_array();
|
||||
|
||||
|
||||
$smarty->assign('mail_vorname', "$row_empf[vorname]");
|
||||
$smarty->assign('mail_nachname', "$row_empf[nachname]");
|
||||
$smarty->assign('mail_mailadr', "$row_empf[mail]");
|
||||
|
||||
}
|
||||
|
||||
if($action == 'ausgabe2'){
|
||||
$empfaenger = "$global_adminmail";
|
||||
$betreff = $_POST['betreff'];
|
||||
$text = stripslashes( $_POST['inhalt'] );
|
||||
$sender = $_POST['sender'];
|
||||
$sendermail = $_POST['sendermail'];
|
||||
if(isset($_POST['kopie'])){
|
||||
$kopie = $_POST['kopie'];
|
||||
}else{
|
||||
$kopie = "";
|
||||
}
|
||||
// echo"$empfaenger<p>$betreff<p>$text<p>$sender<p>$sendermail";
|
||||
// Emailversand:
|
||||
if (isset($kopie))
|
||||
{
|
||||
$empfaenger .= ", $sendermail";
|
||||
}
|
||||
|
||||
if($betreff == '' OR $text == ''){
|
||||
$smarty->assign('mail_mandatory', "1");
|
||||
}else{
|
||||
|
||||
## Mailversand:
|
||||
$headers = "MIME-Version: 1.0\n";
|
||||
#$headers .= "Content-type: text/html; charset=iso-8859-1\n";
|
||||
$headers .= "Content-type: text/html; charset=utf-8\n";
|
||||
$headers .= "From: $sender <$sendermail>\n";
|
||||
#$headers .= "Bcc: $empfaenger\n";
|
||||
|
||||
$return = @mail($empfaenger, $betreff, $text, $headers);
|
||||
|
||||
// Bestätigungsseite
|
||||
if ($return){
|
||||
$smarty->assign('mail_success', "1");
|
||||
}else{
|
||||
$smarty->assign('mail_success', "2");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$smarty->assign('action', "$action");
|
||||
$smarty->display("$template/$templatename");
|
||||
?>
|
Reference in New Issue
Block a user