Jump to content

Archived

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

jcavard

Problem with new line (\n) in plain text email on MAC

Recommended Posts

Hi!

I use PHPMailer to send mail. I use \n as line carriage (new line) on a PC it works great but on a MAC it seems like \n doesnt work... it print all the text on the same line...

Share this post


Link to post
Share on other sites
[!--quoteo(post=349095:date=Feb 24 2006, 01:32 PM:name=jcavard)--][div class=\'quotetop\']QUOTE(jcavard @ Feb 24 2006, 01:32 PM) [snapback]349095[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Hi!

I use PHPMailer to send mail. I use \n as line carriage (new line) on a PC it works great but on a MAC it seems like \n doesnt work... it print all the text on the same line...
[/quote]

try using "\r\n" instead. typically, it's windows machines that need the \r, but it's worth a shot.

Share this post


Link to post
Share on other sites
Newline codes::

[code]Unix/linux    \n
Mac           \r
Windows       \r\n[/code]

Share this post


Link to post
Share on other sites
This is probably because of the different types of line breaks on the different OSes.

Here's how the line breaks work in

Unix: \n
Mac: \r
Windows: \n\r

Use \n\r to be safe :)

[b]edit: [/b]Barand's too quick ;)

Share this post


Link to post
Share on other sites

×

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.