Registriert seit: 24. Mär 2004
Ort: bei Hannover
2.416 Beiträge
Delphi XE5 Professional
|
Re: [PHP] Bild via E-Mail schicken
20. Nov 2007, 15:32
Code:
if ($_SERVER['REQUEST_METHOD']=='POST')
{
if (!(stristr($_FILES["Fotofile"]["type"],"image/"))||($_FILES["Fotofile"]["size"] > 5000000))
{
$foto_fehler=true;
} else {
$to = "sdfgdsfg@dsfgdsfg.dfgsdfg";
$subject .= " dsgdsg: " ;
$headers = "From: Webformular <hjgkghk@hgjk.hgjk>" . "\r\n";
$headers .= "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: " . mime_content_type($_FILES["Fotofile"]["tmp_name"]) . "\r\n";
$headers .= "Content-Transfer-Encoding: base64" . "\r\n";
$message = base64_encode(file_get_contents($_FILES["Fotofile"]['tmp_name'])) . "\r\n";
unlink($_FILES["Fotofile"]['tmp_name']);
mail($to, $subject, $message, $headers);
}
}
|