Open Outlook.exe from cmd with body text containing newlines

烂漫一生 提交于 2019-12-13 02:51:38

问题


I'm trying to open Microsoft Outlook 2010 from cmd, but I'd like the body of the email to contain line breaks/newlines.

"C:\Programs\Microsoft Office\Office14\OUTLOOK.EXE" /c ipm.note /m "myemail@email.com&cc=seconda.address@email.com&subject=Test&body=Line 1 \r\n Line 2"

With that outlook 2010 opens correctly with email addresses, the subject but i can't figure out how to automatically insert a newline.

I've tried with /0,
,
, , \r\n, \r\r, $_ but it still write it as simple text.

I know that %20 character puts is a whitespace, but i need a newline.

Is that even possible? No .bat or stuff, just plain command line (windows XP)


回答1:


Try this:

"C:\Programs\Microsoft Office\Office14\OUTLOOK.EXE" /c ipm.note /m "myemail@email.com&cc=seconda.address@email.com&subject=Test&body=Line 1 %0D%0ALine 2"

Replace the \r\n with %0D%0A you can also remove the space on the next line by removing space after adding %0D%0A so something like this %0D%0ALine 2

Below is a link to read up and understand it better. It might come in handy for other possible questions you might have in future

WIKIPEDIA



来源:https://stackoverflow.com/questions/20218018/open-outlook-exe-from-cmd-with-body-text-containing-newlines

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