First, install the "mail-client/mailx" package by using emerge, as root:
emerge mail-client/mailx
echo "Hello World!" | mail -s Subject destination@mailserver.com
This assumes you already have "postfix" installed and configured, which you can check how to do here:
emerge postfix /etc/init.d/postfix start
The test e-mail should arrive to your destination e-mail box of choice. Script away using the command to send e-mails in batch or to warn the sysadmin of problems in the box.
No comments:
Post a Comment