Search code examples
javaemailoutlooknewlineline-breaks

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


I'm trying to send an email in Java but when I read the body of the email in Outlook, it's gotten rid of all my linebreaks. I'm putting \n at the ends of the lines but is there something special I need to do other than that? The receivers are always going to be using Outlook.

I found a page on microsoft.com that says there's a 'Remove line breaks' "feature" in Outlook so does this mean there's no solution to get around that other than un-checking that setting?

Thanks


Solution

  • You need to use \r\n as a solution.