Code:
/path/to/sendmail "some.user@some.domain" << EOF
From: Me <my.mail@my.domain>
To: Recipient <other.mail@my.domain>
Subject: test mail - $variable
`date "+%A %e %b %Y %T"` - report n. $number
`cat /path/to/file.txt`
Best regards,
Alex
EOF
Using sendmail you can use a shell "here document" and can include the output of any command, the content of a file and any other text. If you need to send attachment, I suggest uuenview, which uses sendmail as well:
Code:
/path/to/uuenview -m $email -f "$from" -s "$subject" -a $file << EOF
See $file in attachment.
Best regards,
Alex
EOF
Hope this helps.