In Gentoo, install
mail-client/mailx. In other distros, an adequate package for the Heirloom mailx client.
The command to send a mail with a preconfigured body (in
body.txt file) and the attachment in an Office document (e.g.
attachment.odt file) is as follows:
(echo -e "To: email@example.com"; cat body.txt) | mail -t -a attachment.odt
body.txt file has the following structure:
cat body.txt Bcc: firstname.lastname@example.org Reply-To: email@example.com Subject: This is an email subject Dear Recipient, blabla...