1

I'm sending an email using javascript. It will be sent via outlook but I can't seem to get outlook to accept the linebreaks. It recognizes them as line breaks since it doesn't display them. But no line breaks are visible. I've read that outlook apparently removes extra line breaks. I've tried several things I've read to get around this but to no avail

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

Tried everything there. Nothing works...

mailto_link = 'mailto:'+email_'?subject='+subject+'&body-'+body_message;
window.open(mailto_link, 'emailWindow');

That's the method I'm using to create the e-mail. If there is a better solution or some way to force outlook to accept html editing, that would work too.

Community
  • 1
  • 1
cphilpot
  • 945
  • 2
  • 11
  • 35
  • Where is the code that inserts the line breaks? – James Hill Mar 16 '12 at 14:45
  • The question you linked uses `Java` which is [not the same as `JavaScript`](http://stackoverflow.com/questions/245062/whats-the-difference-between-javascript-and-java). – zzzzBov Mar 16 '12 at 15:56

1 Answers1

3

try to force newline with %0D%0A sequence in the body_message variable

edit: see How to break line in JavaScript?

Community
  • 1
  • 1
Fabrizio Calderan loves trees
  • 109,094
  • 24
  • 154
  • 160
  • What exactly is that supposed to do? (it erased all the text after it lol) – cphilpot Mar 16 '12 at 14:48
  • It helps if I use a % and not a /. Thanks, I never found that particular one but I was using email in my search so it never returned that page. – cphilpot Mar 16 '12 at 14:53