Select Page

Outlook/Gmail removes line breaks

I had a run in, with the particular feature of outlook, developing an application that sent plain-text emails.
I had code very similar to the following

which would result in the following plain-text

Hello,\r\n
Please update the following:\r\n
\r\n
Item1\r\n
Item2\r\n
Item3\r\n

But outlook would show me the following

Hello,\r\n
Please update the following:\r\n

Item1Item2Item3

Most solutions to this include creating the email as HTML instead.

This is fortunately NOT needed.

Outlook uses certain rules to determine something called “Continuation”.
* Every message starts with continuation off.
* Lines less than 40 characters long do not trigger continuation, but if continuation is on, they will have their line breaks removed.
* Lines 40 characters or longer turn continuation on. It remains on until an event occurs to turn it off.
* Lines that end with a period, question mark, exclamation point or colon turn continuation off. (Outlook assumes it’s the end of a sentence?)
* Lines that turn continuation off will start with a line break, but will turn continuation back on if they are longer than 40 characters.
* Lines that start or end with a tab turn continuation off.
* Lines that start with 2 or more spaces turn continuation off.
* Lines that end with 3 or more spaces turn continuation off.

Credits:

mtruesdell and his SO answer here