Search code examples
batch-fileoutlookdosline-breaksbatch-processing

DOS Batch that sends email via outlook: need to add new lines


Here is part of my batch:

start "" "C:\Program Files (x86)\Microsoft Office\Office12\OUTLOOK.EXE" /c ipm.note /m "email address&cc=email address 2;email address 3&subject=Very Important Alert&body=Line 1 of alert\nLine 2 of alert"

This is just inserting the literal \n into the body though. How do I get it to insert actual line breaks?


Solution

  • Try this:

    "...&body=Line 1 of alert\r\nLine 2 of alert"
    

    Or this:

    "...&body=Line 1 of alert%%0D%%0ALine 2 of alert"