Riaan's SysAdmin Blog

My tips, howtos, gotchas, snippets and stuff. Use at your own risk!

Uncategorized

Unix text mail to Outlook missing newlines

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"

admin

Bio Info for Riaan