I am using JavaScript to formulate a mailto:
URI, but for some reason the \n
characters are not working.
My string is constructed like this:
var emailBody = "This is the first line!\n" +
"This is the next line.\n" +
"And so on and so forth.\n";
And then I form a URL like:
var mailToLink = 'mailto:' + emailTo
+ '?subject=' + emailSubject
+ '&body=' + emailBody;
and instruct the browser to navigate to that URI:
var win = window.open(mailToLink, 'emailWindow');
My email client opens with the draft email in the window, but all the "lines" are displayed consecutively. I see no line breaks, except those rendered due to the email client's natural word wrapping.
How can I generate this email with the newline characters intact?
` – arcyqwerty Sep 23 '15 at 18:56
work instead of \n? – Chris Sep 23 '15 at 19:01