I am losing line endings when sending an email from Linux to Windows using 'mail'.
I have tried all ways of doing this, setting the multiline 'body' text as a variable and then piping this into mail, using here-document style input of a text file into mail. Either way, when the email arrives in Windows Outlook I lose all my line endings.
releasenotes=$(tail -n5 ./ReleaseNote)
echo -e "$releasenotes" | mail -s "$ALERT_EMAIL_SUBJECT" "$ALERT_EMAIL_ADDR"
I can confirm the ./ReleaseNote file does indeed have the line endings in place.
I have tried doing a unix2dos conversion but the email then arrives in Outlook with a .bin attachment.
Can anyone help ? I have spent hours on this tonight.