Hello!
I have a strange trouble. I use a simple script, sending email via the mail() function. I had it working properly, sending the message with the defined by "\n" new lines and encoded in ANSI/windows-1251. Today I changed the encoding to utf-8/utf-8 (coding of the file when being saved/value in the head meta tag for encoding in the begining of the html). A strange thing happened. The new lines was not working at all and I was recieving the whole messssage on one line! Then I tried replacing \n woth \r\n but there was no effect! The I read in one forum post on php.net to replace \r\n with chr(13) . chr(10) and there was no effect again!
Please, help! How to get that new lines working properly? 😕
here is the code:
$from = "MIME-Version: 1.0\r\n";
$from .="Content-type: text/html; charset=utf-8\r\n";
$from .="Content-Transfer-Encoding: 7bit\r\n";
$from .="From: Livescore-bg.net <admin@livescore-bg.net>";
$subject = "=?UTF-8?B?" . base64_encode("Забравена парола в Livescore-bg.net") . "?=";
$message = "Вашата парола за достъп в Livescore-bg.net e:".chr(13) . chr(10)
. $row['password'] . chr(13) . chr(10).chr(13) . chr(10)."
Поздрави, ".chr(13) . chr(10)."
Livescore-bg.net";
mail($row['email'], $subject, $message, $from);