<?
########## Confixx(R) 3.0 Professional ############
####### Copyright SWsoft, Inc. 2004-2005 ##########
#### http://www.sw-soft.com - info@sw-soft.com ####

include_once("auth.php");

db_connect($db_host, $db_user, $db_pass);

noMagic($emailbetreff);
noMagic($emailtext);
noMagic($absenderemail);
noMagic($absendername);

##inhalt der mail speichern

$mail  = "From: \"$absendername\" <$absenderemail>\n";
$mail .= "Subject: $emailbetreff\n\n";
$mail .= "$emailtext";

$mail = str_replace("'", "\'", $mail);
$absenderemail = str_replace("'", "\'", $absenderemail);

$id = safe_query2( "insert into nlinhalt (mail,von) VALUES (?,?)", new SQLString($mail), new SQLString($absenderemail) );

$mailid = db_insert_id($id,"seq_nlinhalt");

##/inhalt der mail speichern

##emailadressen speichern

for ($i=0; $i < count($empfaenger); $i++)
	{
	 $emailadresse = str_replace("'", "\'", $empfaenger[$i]);
	 safe_query2( "insert into nladressen (mailid,emailadresse) VALUES ($mailid, ?)", new SQLString($empfaenger[$i]));
	}
db_query("update allgemein set newsletter=1");
##/emailadressen speichern

db_close();

$emailtext = "";
$absendername = "";
$absenderemail = "";
$emailbetreff = "";
$fehlertitel = ltext("kuru3_errortitle");
$fehlertext = ltext("kuru3_error1");
require("kunden_rundschreiben.php");
?>
