I am writing a script that sends log files via the terminal to my email address. It appears, that when I'm using the
-A flag, the message itself does not show in the email.
echo "This is the message I want to be shown in the email, but it does not appear." | mail -s "any subject" -A <path to attachement> firstname.lastname@example.org
Here is a snippet from the script that may make the situation clearer:
email@example.com' log="/var/log/apt/$(date +"%Y%m%d")-apt-update.log" echo "Update done" | mail -s "update done" -A $log $mail
When I am sending the mail without
-A and without the attachment (only with the subject) then the message I am echoing does appear.
Thanks in advance.