#!/bin/bash
MESSAGE="Line one. /n"
MESSAGE="$MESSAGE Line two. /n"
MESSAGE="$MESSAGE Line three."
echo $MESSAGE | mail -s "test" "[email protected]"
Is that how I should get each line, on its own line?
Use a heredoc.
mail -s "test" "[email protected]" << END_MAIL
Line one.
Line two.
Line three.
END_MAIL
Change:
echo $MESSAGE | mail -s "test" "[email protected]"
To:
echo -e $MESSAGE | mail -s "test" "[email protected]"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With