How do I format a String in an email so Outlook will print the line breaks? How do I format a String in an email so Outlook will print the line breaks? java java

How do I format a String in an email so Outlook will print the line breaks?


I've just been fighting with this today. Let's call the behavior of removing the extra line breaks "continuation." A little experimenting finds the following behavior:

  • 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.

Please note that I tried all of this with Outlook 2007. YMMV.
So if possible, end all bullet items with a sentence-terminating punctuation mark, a tab, or even three spaces.


You can force a line break in outlook when attaching one (or two?) tab characters (\t) just before the line break (CRLF).

Example:

This is my heading in the mail\t\nJust here Outlook is forced to begin a new line.

It seems to work on Outlook 2010. Please test if this works on other versions.

See also Outlook autocleaning my line breaks and screwing up my email format