... sieht alles schon besser aus.
Template:
Code: Alles auswählen
<div id="contactForm">
<form action="{form_action}" method="post">
<input type="hidden" name="send" value="1" />
<div class="contactRow clearfix">
<br><br><hr size=1><br><b><h3>NUTZEN SIE UNSER KONTAKTFORMULAR</h3></b><br>
<table cellpadding="0" cellspacing="0">
<tr>
<td colspan="8">Bitte wählen Sie Ihren Ansprechpartner:<br><br></td>
<td class="pt" style="text-align:right;"></td>
</tr>
<tr>
<td colspan="8"><select name="Ansprechpartner">
<option value="1">Verkauf</option>
<option value="2">Werkstatt</option>
<option value="3">Buchhaltung</option>
</select></td>
<td class="pt" style="text-align:right;"></td>
</tr>
<tr>
<td height="30" colspan="8"> </td>
<td class="pt" style="text-align:right;"></td>
</tr>
<tr>
<td class="pt" style="width:80px;"><label for="Anrede">{ANREDE}</label></td>
<td style="width:10px;"><input type="radio" name="Anrede" value="{ANREDE_OPTION1}" id="Anrede" checked="checked" style="width:auto;border:0;" /></td>
<td class="pt">{ANREDE_OPTION1}</td>
<td style="width:10px;"><input type="radio" name="Anrede" value="{ANREDE_OPTION2}" style="width:auto;border:0;" /></td>
<td class="pt">{ANREDE_OPTION2}</td>
<td class="pt" style="text-align:right;"></td>
</tr>
</table>
</div>
<div class="contactRow clearfix">
<label for="Vorname">{VORNAME} *</label>
<input type="text" name="Vorname" id="Vorname" class="input" maxlength="100"/>
</div>
<div class="contactRow clearfix">
<label for="Name">{NACHNAME} *</label>
<input type="text" name="Nachname" id="Nachname" class="input" maxlength="100"/>
</div>
<div class="contactRow clearfix">
<label for="Firma">{FIRMA} </label>
<input type="text" name="Firma" id="Firma" class="input" maxlength="100"/>
</div>
<div class="contactRow clearfix">
<label for="Strasse">{STRASSE} </label>
<input type="text" name="Strasse" id="Strasse" class="input" maxlength="100"/>
</div>
<div class="contactRow clearfix">
<label for="PLZOrt">{PLZORT} </label>
<input type="text" name="PLZOrt" id="PLZOrt" class="input" maxlength="100"/>
</div>
<div class="contactRow clearfix">
<label for="Telefon">{TELEFON} *</label>
<input type="text" name="Telefon" id="Telefon" class="input" maxlength="100"/>
</div>
<div class="contactRow clearfix">
<label for="EMail">{EMAIL} </label>
<input type="text" name="EMail" id="EMail" class="input" maxlength="100"/>
</div>
<div class="contactRow clearfix">
<label for="Anliegen">{ANLIEGEN} *</label>
<textarea name="Anliegen" id="Anliegen"></textarea>
</div>
<div id="contactFormSubmit" class="clearfix">
<div id="absenden"> <div id="contactFormSubmitLeft">
<input type="reset" value="{LOESCHEN}" />
</div>
<div id="contactFormSubmitRight">
<input type="submit" value="{ABSCHICKEN}" />
</div></div>
</div>
</form>
</div>
<p><br>
* {PFLICHTFELDER}</p>
MODUL:
Code: Alles auswählen
<?php
/**
* $RCSfile$
*
* Description: Contact Form Output
*
* @version 1.0.0
* @author Andreas Lindner
* @copyright four for business AG <www.4fb.de>
*
* {@internal
* created 2005-08-12
* modified 2008-04-11 Rudi Bieller Changes concerning new layout
* }}
*
* $Id$
*/
#Includes
cInclude("classes", "class.phpmailer.php");
if (!isset($tpl) || !is_object($tpl)) {
$tpl = new Template();
}
if (!isset ($_POST['send'])) {
#Form has not been sent yet
cInclude('classes', 'class.article.php');
cInclude('classes', 'class.template.php');
#Create contact form
$sFormAction = $sess->url("front_content.php?idcat=$idcat&idart=$idart&parentid=$parentid");
$tpl->set("s", 'form_action', $sFormAction);
$tpl->set("s", "ANREDE", mi18n("Anrede"));
$tpl->set("s", "ANREDE_OPTION1", mi18n("Herr"));
$tpl->set("s", "ANREDE_OPTION2", mi18n("Frau"));
$tpl->set("s", "NACHNAME", mi18n("Name"));
$tpl->set("s", "VORNAME", mi18n("Vorname"));
$tpl->set("s", "FIRMA", mi18n("Firma"));
$tpl->set("s", "STRASSE", mi18n("Straße/Nr."));
$tpl->set("s", "PLZORT", mi18n("PLZ/Ort"));
$tpl->set("s", "TELEFON", mi18n("Telefon"));
$tpl->set("s", "EMAIL", mi18n("E-Mail"));
$tpl->set("s", "ANLIEGEN", mi18n("Nachricht"));
$tpl->set("s", "PFLICHTFELDER", mi18n("Bitte alle Felder ausfüllen"));
$tpl->set("s", "ABSCHICKEN", mi18n("abschicken"));
$tpl->set("s", "LOESCHEN", mi18n("löschen"));
$tpl->generate($cfgClient[$client]["path"]["frontend"]."templates/kontaktformular.html");
} elseif ($_POST['send'] == 1) {
#Form has been sent
#Check user input
$noerrors = true;
$msg = '';
if ($_POST['Vorname'] == '') {
$noerrors = false;
$msg .= mi18n("Bitte geben Sie Ihren Vornamen ein!")."<br/>";
}
if ($_POST['Nachname'] == '') {
$noerrors = false;
$msg .= mi18n("Bitte geben Sie Ihren Namen ein!")."'<br/>";
}
if ($_POST['Telefon'] == '') {
$noerrors = false;
$msg .= mi18n("Bitte geben Sie Ihre Telefonnummer an!")."'<br/>";
}
if ($noerrors == false) {
echo "<p>";
#Errors have been found
echo "<strong>".mi18n("Beim Versenden sind folgende Fehler aufgetreten:")."</strong><br/>";
echo $msg.'<br/>';
echo '<a href="javascript:history.back();">‹ '.mi18n("zurück").'</a>';
} else {
#No errors, create and send mail
$mail = new phpmailer;
$mail_body = '<html><head></head><body bgcolor="#ffffff"><table cellspacing="0" cellpadding="2" border="0">';
if (is_array($_POST)) {
foreach ($_POST as $key => $value) {
if ($key != 'send') {
$mail_body .= "<tr><td>$key</td><td>$value</td></tr>";
}
}
}
$mail_body .= '</table></bo'.'dy></html>';
$mail->Host = "localhost";
$mail->IsHTML(true);
#Get mailer from settings
switch (strtolower("CMS_VALUE[4]")) {
case "smtp" :
$mail->IsSMTP();
$host = "CMS_VALUE[5]";
$user = "CMS_VALUE[6]";
$password = "CMS_VALUE[7]";
if (($host != '') && ($user != '') && ($password != '')) {
$mail-> $SMTPAuth = true;
$mail->Host = $host;
$mail->Username = $user;
$mail->Password = $password;
}
break;
case "mail" :
$mail->IsMail();
break;
case "sendmail" :
$mail->IsSendmail();
break;
case "qmail" :
$mail->IsQmail();
break;
default :
}
$mail->From = "CMS_VALUE[0]";
$mail->FromName = "CMS_VALUE[2]";
$mail->AddAddress("CMS_VALUE[1]", "");
if($_POST["Ansprechpartner"]==1) { $mail->AddAddress("gerald@xxx.de","Empfängername 1"); }
if($_POST["Ansprechpartner"]==2) { $mail->AddAddress("info@xxx.de","Empfängername 2"); $mail->AddAddress("eMail-Adresse 4","Empfängername 4"); }
if($_POST["Ansprechpartner"]==3) { $mail->AddAddress("test@xxx.de","Empfängername 3"); }
$mail->Subject = "CMS_VALUE[3]";
$mail->Body = $mail_body;
$mail->WordWrap = 50;
$mail->Send();
#Display message after mail is sent
echo mi18n("Ihr Anliegen wurde uns übermittelt. Vielen Dank!")."<br/>";
}
}
?>
Folgendes habe ich gelöscht:
$mail->AddAddress("CMS_VALUE[1]", ""); ZEILE 120
Wofür ist das:
$mail->AddAddress("eMail-Adresse 4","Empfängername 4");
Wenn ich das weglasse funktionierts!
Ich hoffe das hat keine Nachteile mit dem weglassen.
VIELEN DANK FÜR DEINE HILFE!!!!!