Open Outlook.exe from cmd with body text containing newlines

13,627

Try this:

"C:\Programs\Microsoft Office\Office14\OUTLOOK.EXE" /c ipm.note /m "[email protected]&[email protected]&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

Share:
13,627
MarcoR
Author by

MarcoR

Updated on June 05, 2022

Comments

  • MarcoR
    MarcoR about 2 years

    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 "[email protected]&[email protected]&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)

  • Robino
    Robino over 8 years
    Guys, if someone writes a great answer, please up vote rather than saying "thanks".