Camen Design Forum

php mail and strange \r\n behaviour in headers part


Hi aweryone,

Im bild simple cms sistem with mail sent.

Afther one week without any problems next source start FAILed -

$headers .= "Importance: High\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "Content-Transfer-Encoding: 8bit";

IF(mail($email, $subject, $message, $headers, " -f".$email) === TRUE)...

So, fail is in \r\n, between -
...MIME-Version: 1.0\r\ncontent-type: text/html; charset=iso-8859-1... - FAIL

...MIME-Version: 1.0\r\n content-type: text/html; charset=iso-8859-1... - TRUE
but html content of the mail is in plain text.

so im tray to change first letter of - content to ANSII - &-#-67;ontent... and works,
but again with html in plain text.

but\r\n between -
...content-type: text/html; charset=iso-8859-1\r\nContent-Transfer-Encoding: 8bit... is TRUE !

Allso, have to change prewious mail verification to next -
IF(mail($email, $subject, $message, $headers))...

Have no any idea, but i thing, problem is in hosting server.

Please, someone can help me ?

Thanks a lot.


(Leave this as-is, it’s a trap!)

Only the original author or a moderator can append to this post.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn