Skip to content

Unix text mail to outlook missing newlines

wordpress meta

title: 'Unix text mail to Outlook missing newlines'
date: '2014-09-23T11:01:51-05:00'
status: publish
permalink: /unix-text-mail-to-outlook-missing-newlines
author: admin
excerpt: ''
type: post
id: 741
category:
    - Uncategorized
tag: []
post_format: []

If you like myself have spent way too much time with Outlook chomping newlines in a simple text email this little workaround worked for me. Assuming of course you do actually have newlines in your text that you are sending you can just use sed to add two spaces to the start of each line.

echo "$notifymessage" | sed 's/^/  /g' | mailx -r $fromuser -s "Monitor on $HOSTNAME" "$mail"