<?php
if ((isset($_POST['sendmail'])) && (!empty($_POST['mailto']))&& (!empty($_POST['message'])) && (isset($_POST['bildid'])))
{
/*$bilder=mysql_query("select * from bilder where id='".$_POST['bildid']."'");
$bild=mysql_fetch_assoc($bilder);
$message=imap_8bit($_POST['message']);
$message.="\n\n";
$message.="\t".imap_8bit("<<".$bild['dateiname'].">>");
$boundary="----".md5(uniqid());
$email="";
$email.="Content-class: urn:content-classes:message";
$email.="\nUser-Agent: Bildmailer";
$email.="\nMIME-Version: 1.0";
$email.="\nContent-Type: multipart/mixed;\n\tboundary=\"".$boundary."\"";
$email.="\nFrom: ".$fromaddress;
$email.="\nX-Priority: 3 (Normal)";
$email.="\nImportance: Normal";
$email.="\n\n--".$boundary;
$email.="\nContent-Type: text/plain;\n\tcharset=\"iso-8859-1\"";
$email.="\nContent-Transfer-Encoding: quotet-printable";
$email.="\n\n".$message;
$email.="\n\n--".$boundary;
$file=fopen("bilder/".$bild['dateiname'],"r");
$content=fread($file,filesize("bilder/".$bild['dateiname']));
fclose($file);
$encodedfile=chunk_split(base64_encode($content));
$email.="\nContent-Type: application/octet-stream;\n\tname=\"".$bild['dateiname']."\"";
$email.="\nContent-Transfer-Encoding: base64";
$email.="\nContent-Description: ".$bild['dateiname'];
$email.="\nContent-Disposition: attachment;\n\tfilename=\"".$bild['dateiname']."\"";
$email.="\n\n".$encodedfile."\n\n--".$boundary;
$email.="--";
imap_mail($_POST['mailto'],"Bild","",$email);*/
echo "Mail wurde verschickt";
}
?>