I want to send an email from Linux with body and attachment. However, it only sends either one of the two. When I have both in the command, only the attachment is sent. I'm working with a log file as body and a CSV file as an attachment. I have tried the following;
mail -a "FROM: Name <name@email.com>" -s "subject of email" "recipient@email.com" -A /home/Export/attachment.csv <<< "$BODY_SUCCES"
For which the variable $BODY_SUCCESS is a log file. I have also tried making it work with mutt and mailx, but neither seemed to work, unfortunately. I can't figure out what's going wrong here. Can anyone help?