On Mon, 10 Feb 2025 11:38:43 -0500
Tug Williams <tug [ dot ] williams [ at ] gmail [ dot ] com> wrote:
> echo -e "Subject:midnight report for $reportDate\n$(cat $targetFile)"
> | sendmail -f "me [ at ] example [ dot ] com" -t "you [ at ] example [ dot ] com"
You can also use mail, which on Debian is packaged in
mailutils.
mail -s "Midnight report for $reportDate" \
-r me [ at ] example [ dot ] com you [ at ] example [ dot ] org < $targetFile
which is probably safer than catting some random file and having "echo -e"
process escape sequences.
Internally, mail invokes sendmail for you, so you get the nice queueing
behaviour.
Regards,
Dianne.
To unsubscribe send a blank message to linux+unsubscribe [ at ] linux-ottawa [ dot ] org
To get help send a blank message to linux+help [ at ] linux-ottawa [ dot ] org
To visit the archives: https://lists.linux-ottawa.org