I'm trying to send a mail with a subject, a unique receiver, and few lines of text in the body. Almost everything is working as expected, except the body gets attached as a file instead of being in the mail's body.
Here is my code:
destinataire="[email protected]"
obj="** ALERTE BACKUP sur $host pour le dump DB de $db** "
body="Erreur lors du dump de la DB $db sur l'hote $host\n"
body="$body - Code erreur: $ret\n"
body="$body - Env: $prodfolder\n"
body="$body \n\nMail envoyé a $destinataire"
echo $body | mail -s "$obj" ${destinataire}
The content of $body gets transformed into a file, and attached to the mail. I don't understand what I am doing wrong, or if there is any additional configuration to do?