Page 1 of 1

Postfix verschluckt Kommentare

Posted: 2008-07-21 16:53
by dohǃ
Schönen Nachmittag,

immer wenn ich versuche in PHP mittels mail-Funktion eine E-Mail mit eingebauten Kommentar zu versenden, erhalte ich sie, aber vom Kommentar fehlt jede Spur... woran kann das liegen? <b>, etc. funktioniert.

Code: Select all

$message = "Ich bin ein Test. <!-- Ich bin ein Kommentar -->";

$header = "From: me@localhost.local";
$header .= "nMIME-Version: 1.0";
$header .= "nContent-Type: multipart/alternative;";
$header .= "n        boundary="----=_NextPart_$theboundary"";

$body = "This is a multi-part message in MIME format.nn";
$body .= "------=_NextPart_$theboundarynContent-Type: text/html; charset=utf-8nn";
$body .= $message;
$body .= "nn";

mail("me@localhost.local", "XML-Test", $body, $header);

Re: Postfix verschluckt Kommentare

Posted: 2008-07-21 17:45
by Joe User

Code: Select all

grep short /path/to/php.ini

Re: Postfix verschluckt Kommentare

Posted: 2008-09-17 12:37
by dohǃ

Code: Select all

; NOTE: Using short tags should be avoided when developing applications or
; servers which are not under your control, because short tags may not
; be sure not to use short tags.
short_open_tag = On
Kann es wirklich daran liegen?

Re: Postfix verschluckt Kommentare

Posted: 2008-09-17 21:17
by Roger Wilco
Wie sieht das vollständige Skript aus?

Re: Postfix verschluckt Kommentare

Posted: 2008-09-22 15:56
by dohǃ
Wie bereits gepostet:

Code: Select all

<?php

$message = "Ich bin ein Test. <!-- Ich bin ein Kommentar -->";

$header = "From: me@localhost.local";
$header .= "nMIME-Version: 1.0";
$header .= "nContent-Type: multipart/alternative;";
$header .= "n        boundary="----=_NextPart_$theboundary"";

$body = "This is a multi-part message in MIME format.nn";
$body .= "------=_NextPart_$theboundarynContent-Type: text/html; charset=utf-8nn";
$body .= $message;
$body .= "nn";

mail("me@localhost.local", "XML-Test", $body, $header);

?>

Re: Postfix verschluckt Kommentare

Posted: 2008-09-22 20:13
by Roger Wilco
Und wie bereits beim letzen mal fehlt ein sinnvoller (oder überhaupt ein) Wert für $theboundary. Benutze doch lieber PEAR::Mail_MIME für die Konstruktion deiner Mails.