*saug*
-> *plopp*
<HTML>
<HEAD>
<TITLE>eMail-senden</TITLE>
<BODY>
<?php
echo $font = "<FONT SIZE=2 FACE=\"Verdana, Arial, Helvetica\">";
/* encoding: bei binären Daten base64, ansonsten 8bit */
$contenttypes = array(
"text/plain" => array("encoding"=>"8bit" ,"info"=>"purer Text"),
"text/html" => array("encoding"=>"8bit" ,"info"=>"HTML-Dokument"),
"image/gif" => array("encoding"=>"base64","info"=>"Bild: GIF"),
"image/jpeg" => array("encoding"=>"base64","info"=>"Bild: JPEG"),
"image/png" => array("encoding"=>"base64","info"=>"Bild: PNG"),
"image/psd" => array("encoding"=>"base64","info"=>"Bild: PSD"),
"application/x-zip-compressed" => array("encoding"=>"base64","info"=>"Komprimiert: ZIP"),
"application/x-gzip" => array("encoding"=>"base64","info"=>"Komprimiert: GZ"),
"application/x-tar" => array("encoding"=>"base64","info"=>"Komprimiert: TAR")
);
if($von && $mail_content) {
$mail_header = "From: $von";
if($anhang=="jep" && $dateiname && $datei && $datei != "none") {
$datei_content = fread(fopen($datei,"r"),filesize($datei));
if($contenttypes[$anhang_content_type][encoding]=="base64") $datei_content = base64_encode($datei_content);
else $datei_content = $datei_content;
$boundary = strtoupper(md5(uniqid(time())));
$mail_header .= "\nMIME-Version: 1.0";
$mail_header .= "\nContent-Type: multipart/mixed; boundary=$boundary";
$mail_header .= "\n\nThis is a multi-part message in MIME format -- Dies ist eine mehrteilige Nachricht im MIME-Format";
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: $content_type";
$mail_header .= "\nContent-Transfer-Encoding: 8bit";
$mail_header .= "\n\n$mail_content";
$mail_header .= "\n--$boundary";
$mail_header .= "\nContent-Type: $anhang_content_type; name=\"$dateiname\"";
$mail_header .= "\nContent-Transfer-Encoding: ".$contenttypes[$anhang_content_type][encoding];
$mail_header .= "\nContent-Disposition: attachment; filename=\"$dateiname\"";
$mail_header .= "\n\n$datei_content";
$mail_header .= "\n--$boundary--";
} else {
$mail_header .= "\nContent-Type: $content_type";
$mail_header .= "\nContent-Transfer-Encoding: 64bit";
$mail_header .= "\n\n".$mail_content;
}
flush();
if(@mail($an,$subject,"",$mail_header)) echo "Die eMail mit dem Betreff ".htmlentities($subject)." wurde an ".htmlentities($an)." gesendet.";
else echo "Es ist ein Fehler beim senden der eMail aufgetreten.";
} else {
?>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>
<FORM METHOD=post ENCTYPE="multipart/form-data" ACTION="<?php echo $PHP_SELF; ?>">
<TR><TD><?php echo $font; ?><B>An: </TD><TD><INPUT TYPE=text SIZE=40 NAME=an VALUE="mm@webaid.de"></TD></TR>
<TR><TD><?php echo $font; ?><B>Von: </TD><TD><INPUT TYPE=text SIZE=40 NAME=von VALUE="anonymous <mailscript@webaid.de>"></TD></TR>
<TR><TD><?php echo $font; ?><B>Betreff: </TD><TD><INPUT TYPE=text SIZE=40 NAME=subject VALUE=""></TD></TR>
<TR><TD><?php echo $font; ?><B>Inhaltstyp: </TD><TD><SELECT NAME=content_type><OPTION VALUE="text/plain">Standard: Text<OPTION VALUE="text/html">HTML-Mail</SELECT></TD></TR>
<TR><TD COLSPAN=2><?php echo $font; ?><B>Folgender Text wird in der eMail versendet: </TD></TR>
<TR><TD COLSPAN=2><TEXTAREA NAME="mail_content" COLS="60" ROWS="10"></TEXTAREA></TD></TR>
<TR><TD><?php echo $font; ?><BR><B><INPUT TYPE=checkbox NAME=anhang VALUE="jep">Anhang: </TD><TD></TD></TR>
<TR><TD><?php echo $font; ?>Datei: </TD><TD><INPUT TYPE=file SIZE=20 NAME=datei></TD></TR>
<TR><TD><?php echo $font; ?>Dateiname in Mail: </TD><TD><INPUT TYPE=text SIZE=20 NAME=dateiname VALUE=""></TD></TR>
<TR><TD><?php echo $font; ?>Inhaltstyp: </TD><TD><SELECT NAME=anhang_content_type>
<?php
reset($contenttypes);
$key=key($contenttypes);
while($key != "" || $key=="0") {
echo "<OPTION VALUE=\"$key\">".$contenttypes[$key][info];
next($contenttypes);
$key=key($contenttypes);
}
?>
</SELECT></TD></TR>
<TR><TD><?php echo $font; ?></TD><TD><?php echo $font; ?><INPUT TYPE=submit VALUE="Abschicken"></TD></TR>
</FORM></TABLE>
</FONT>
<?php } ?>
</BODY>
</HTML>
probier das mal aus. das hab ich irggendwo in den weiten des web gefunden.
bye,
mo