bei mir wird die hanze zeit angezeiht das eine ausgabe vorhanden ist aber ich finde einfach nicht wo das ist.
das ist der code
danke im vorraus
das ist der code
PHP-Code:
<?php
# Adresse, an die die Formulardaten gesendet werden sollen:
$mailto = "eclipse_240_hp@gmx.net";
# Maximale Größe des Attachments in Bytes:
$max_attach_size = 2000000;
?>
<html>
<head>
<title></title>
<style type="text/css">
<!--
body { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #000000; background: #ffff3; margin: 20px; padding: 0px; border: 0px; }
.caution { color: red; font-weight: bold; }
-->
</style>
</head>
<body>
<?php
if (isset($_POST["form_submitted"]))
{
// übergebene Variablen ermitteln:
$anrede = $_POST['anrede'];
$name = $_POST['name'];
$vorname = $_POST['vorname'];
$email = $_POST['email'];
$text = $_POST['text'];
// Überprüfungen der Daten:
unset($errors);
if ($email != "" and !preg_match("/^[^@]+@.+\.\D{2,5}$/", $email)) $errors[] = "die E-Mail-Adresse ist fehlerhaft!";
if ($_FILES['probe']['size'] > $max_attach_size) $errors[] = "Attachment zu groß (".number_format($_FILES['probe']['size']/2000000,0,",","")." KB) - Maximalgröße: ".number_format($max_attach_size/2000000,0,",","")." KB";
if (empty($errors))
{
$text = stripslashes($text);
$subject = stripslashes($subject);
if ($name != "") $mail_name=$name; else $mail_name="unbekannt";
if ($email != "") $mail_email = $email; else $mail_email = "email@unknown.xyz";
$ip = $_SERVER["REMOTE_ADDR"];
// Wenn Attachment, dann MIME-Mail erstellen:
if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "")
{
// Datei einlesen und codieren:
$datei_content = fread(fopen($_FILES['probe']['tmp_name'],"r"),filesize($_FILES['probe']['tmp_name']));
$datei_content = chunk_split(base64_encode($datei_content),76,"\n");
// Boundary festlegen:
$boundary = md5(uniqid(rand()));
// Mail-Header:
$mail_header = "From: ".$mail_name." <".$mail_email.">\n";
$mail_header .= "X-Sender-IP: ".$ip."\n";
$mail_header .= "MIME-Version: 1.0\n";
$mail_header .= "Content-Type: multipart/mixed; boundary=\"".$boundary."\"\n";
$mail_header .= "This is a multi-part message in MIME format.\n";
// Mail-Text:
$mail_header .= "--".$boundary;
$mail_header .= "\nContent-Type: text/plain";
$mail_header .= "\nContent-Transfer-Encoding: 8bit";
$mail_header .= "name".$name;
$mail_header .= "\n\n".$vorname;
$mail_header .= "\n\n".$email;
$mail_header .= "\n\n".$text;
// Attachment:
$mail_header .= "\n--".$boundary;
$mail_header .= "\nContent-Type: ".$_FILES['probe']['type']."; name=\"".$_FILES['probe']['name']."\"";
$mail_header .= "\nContent-Transfer-Encoding: base64";
$mail_header .= "\nContent-Disposition: attachment; filename=\"".$_FILES['probe']['name']."\"";
$mail_header .= "\n\n".$datei_content;
// Ende:
$mail_header .= "\n--".$boundary."--";
// Sende E-Mail und gebe Fehler bzw. Bestaetigung aus
if (@mail($mailto ,"Bestellung","",$mail_header,"-f [email]Mail@mydomain.de[/email]")) $sent = true; else $errors[] = "keine Verbindung zum Mailserver - bitte nochmal versuchen";
}
// kein Attachment, normale E-Mail:
else
{
$mail_header = "From: ".$mail_name." <".$mail_email.">\n";
$mail_header .= "X-Sender-IP: $ip\n";
$mail_header .= "Content-Type: text/plain";
$mail_header .= "\n\n".$name;
$mail_header .= "\n\n".$vorname;
$mail_header .= "\n\n".$email;
$mail_header .= "\n\n".$text;
if (@mail($mailto,"Bestellung:",$text,$mail_header,"-f [email]Mail@mydomain.de[/email]")) $sent = true; else $errors[] = "keine Verbindung zum Mailserver - bitte nochmal versuchen";
}
// Kopie an Absender:
if (isset($sent) && isset($email) && $email != "" && isset($_POST['copy']))
{
if (isset($_FILES['probe']['name']) && trim($_FILES['probe']['name']) != "") $copy_mail_text = "Kopie der versendeten E-Mail:\n\n".$text."\n\nAttachment: ".$_FILES['probe']['name']; else $copy_mail_text = "Kopie der versendeten E-Mail:\n\n".$text;
$header= "From: ".$mailto."\n";
$header .= "X-Sender-IP: ".$ip."\n";
// Mail-Text:
$mail_header .= "\nContent-Type: text/plain";
$mail_header .= "\n\n".$name;
$mail_header .= "\n\n".$vorname;
$mail_header .= "\n\n".$email;
$mail_header .= "\n\nFrage:".$text;
@mail($email, "Vielen Dank", $copy_mail_text, $mail_header,"-f [email]Mail@mydomain.de[/email]");
}
}
}
if (empty($sent))
{
if(isset($errors))
{
?><p class="caution">Fehler:</p><ul><?php foreach($errors as $f) { ?><li><?php echo $f; ?></li><?php } ?></ul><br /><?php
}
?><form method="post" action="<?php echo basename($_SERVER["PHP_SELF"]); ?>" enctype="multipart/form-data"><div>
<table align="center">
<tr>
<td>Alle Felder mit einem <font color="#FF0000">*</font> sind auszufüllen!</td>
</tr>
</table>
<table align="center">
<tr>
<td>Anrede:</td>
<td> <select name="anrede">
<option value="Herr"<?php if (isset($anrede)== 'Herr') echo 'SELECTED="SELECTED"' ?>>Herr</option>
<option value="Frau"<?php if (isset($anrede)== 'Frau') echo 'SELECTED="SELECTED"' ?>>Frau</option>
</td>
</tr>
<tr>
<td>Name: <font color="#FF0000">*</font></td>
<td><input type="text" name="name" value="<?php if (isset($name)) echo htmlentities(stripslashes($name)); else echo ""; ?>" size="21" /> </td>
</tr>
<tr>
<td>Vorname: <font color="#FF0000">*</font></td>
<td><input type="text" name="vorname" value="<?php if (isset($vorname)) echo htmlentities(stripslashes($vorname)); else echo ""; ?>" size="21" /> </td>
</tr>
<tr>
<td>E-Mail: <font color="#FF0000">*</font> </td>
<td><input type="text" name="email" value="<?php if (isset($email)) echo htmlentities(stripslashes($email)); else echo ""; ?>" size="21" /> </td>
</tr>
</table>
<br>
<table align="center">
<tr>
<td><div align="center"> Stellen Sie hier Bitte Ihre Fragen.</div></font></td>
</tr>
<tr>
<td><textarea name="text" cols="50" rows="7"><?php if (isset($text)) echo htmlentities(stripslashes($text)); else echo ""; ?></textarea> </td>
</tr>
</table>
<br>
<table align="center">
<tr>
<td><div align="center">Wählen Sie eine Bilddatei von ihrem Rechner aus <font color="#FF0000">*</font>:<br>(Die optimale Bildgröße ist 230x230 px).</div></font> </td>
</tr>
<tr>
<td> <input type="file" size="45" name="probe" value="<?php if (isset($_POST['probe'])) echo htmlentities(stripslashes($_POST['probe'])); else echo ""; ?>" /></td>
</tr>
</table>
<table align="center">
<tr>
<td> <input type="submit" name="form_submitted" value="Senden" /></td>
<td> <input type="reset"></td>
<td> <input type="checkbox" name="copy" value="true" /> Kopie an Ihre E-Mail</font></td>
</tr>
</table>
</form><?php
}
else
{
if (empty($email))
{
header ("Location: [url]http://www.example.com[/url]");
}
else
{
header ("Location: [url]http://www.example.com[/url]");
}
}
?>
</body>
</html>
danke im vorraus
Kommentar