Othmar: Mail mit PHP senden (mit Anhang und text)

Beitrag lesen

Hallo zusammen

Das Mailing funktioniert soweit, dass ich ein attachment mit text versenden kann.
Mein Problem ist dass ich das Logo in den Text integieren möchte.
Ich habe gelesen das man bei Content-Disposition: das Attribut inline verwenden kann, aber beim emailclient erscheint es immer noch als attachment

Danke für Eure Hilfe

Othmar

$betreff = "Test Attachment";
$mail_to = "toblerideen@bluewin.ch";

$file = fopen("tobishop.jpg","rb");
$data = fread($file,filesize("tobishop.jpg"));
fclose($file);

$boundary = "TOBIMAIL";

$from_name = "Tobi Shop - Bestellung";
$from_email = "bestellung@tobishop.ch";

$head = "From: ". $from_name ."<".$from_email.">\n";
$head .= "Reply-To: <".$from_email.">\n";
$head .= "Return-Path: <".$from_email.">\n";
$head .= "MIME-Version: 1.0\n";
$head .="Content-Type: multipart/mixed;\n" ;
$head .= " boundary="{$boundary}"";

$inhalt = "--{$boundary}\n";
$inhalt .= "Content-Type:text/html; charset="iso-8859-1"\n";
$inhalt .= "Content-Transfer-Encoding: 7bit\n\n";
$inhalt .= "Test Email mit Text und Anhang.\n\n";
$inhalt .= "--{$boundary}\n";

$data = chunk_split(base64_encode($data));

$inhalt .= "--{$boundary}\n";
$inhalt .= "Content-Type: image/jpeg;\n";
$inhalt .= " name="tobishop.jpg"\n";
$inhalt .= "Content-Disposition: attachment;\n";
$inhalt .= "filename="tobishop.jpg"\n";
$inhalt .= "Content-Transfer-Encoding: base64\n\n";
$inhalt .= $data . "\n\n";
$inhalt .= "--{$boundary}--\n";

mail($mail_to, $betreff, $inhalt, $head);