Jump to content

PHP mail() text format


sotosk

Recommended Posts

Hello!

 

I have a problem on formatting text witch is being sent by mail.

 

I use this code:

$from = '<[email protected]>';
$to = '[email protected]';

$message = 'a
b
c';

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers .= "From: $from" . "\r\n"; 

mail($to, $subject, $message, $headers);

 

and I'm getting this mail:

"a b c"

 

I 've also tried this:

$message = 'a'."\n".'
b'."\n".'
c';

but i got the same result.

 

As you can see the problem is that i receive amessage that does not contains line brakes.

 

 

I would be grateful for any kind of help!  :)

Link to comment
https://forums.phpfreaks.com/topic/233621-php-mail-text-format/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.