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: firstname.lastname@example.org"; cat body.txt) | mail -t -a attachment.odt
body.txt file has the following structure:
cat body.txt Bcc: email@example.com Reply-To: firstname.lastname@example.org Subject: This is an email subject Dear Recipient, blabla...