javascript email linebreaks

回眸只為那壹抹淺笑 提交于 2020-01-06 02:21:08

问题


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.


回答1:


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

edit: see How to break line in JavaScript?



来源:https://stackoverflow.com/questions/9739354/javascript-email-linebreaks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!